Fix double firing of menu actions

This commit is contained in:
Nick O'Leary 2016-07-05 09:16:27 +01:00
parent d91a99c833
commit 446eb8e978
1 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2014 IBM Corp. * Copyright 2014, 2016 IBM Corp.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -231,16 +231,16 @@ RED.menu = (function() {
var opt = menuItems[id]; var opt = menuItems[id];
if (opt) { if (opt) {
opt.onselect = action; opt.onselect = action;
$("#"+id).click(function() { // $("#"+id).click(function() {
if ($(this).parent().hasClass("disabled")) { // if ($(this).parent().hasClass("disabled")) {
return; // return;
} // }
if (menuItems[id].toggle) { // if (menuItems[id].toggle) {
setSelected(id,!isSelected(id)); // setSelected(id,!isSelected(id));
} else { // } else {
menuItems[id].onselect.call(menuItems[id]); // menuItems[id].onselect.call(menuItems[id]);
} // }
}); // });
} }
} }