Permalink
Browse files

fixes #2832 fix pending node grid (click on button or checkbox)

  • Loading branch information...
1 parent 17548a2 commit 2949234bae49e6af4288f63cba8d6864e74b78e8 @VinceMacBuche VinceMacBuche committed Aug 22, 2012
Showing with 19 additions and 15 deletions.
  1. +19 −15 rudder-web/src/main/scala/com/normation/rudder/web/services/NodeGrid.scala
@@ -158,23 +158,27 @@ class NodeGrid(getNodeAndMachine:LDAPFullInventoryRepository) extends Loggable {
*/
def initJsCallBack(tableId:String) : JsCmd = {
JsRaw("""$( #table_var#.fnGetNodes() ).each( function () {
- $(this).click( function () {
- var opened = $(this).prop("open");
- if (opened && opened.match("opened")) {
- $(this).prop("open", "closed");
- $(this).find("span.listclose").removeClass("listclose").addClass("listopen");
- #table_var#.fnClose(this);
- } else {
- $(this).prop("open", "opened");
- $(this).find("span.listopen").removeClass("listopen").addClass("listclose");
- var jsid = $(this).attr("jsuuid");
- var node = $(this).attr("nodeid");
- var ajaxParam = JSON.stringify({"jsid":jsid , "id":$(this).attr("nodeid") , "status":$(this).attr("nodeStatus")});
- #table_var#.fnOpen( this, fnFormatDetails(jsid), 'details' );
- %s;
+ $(this).click( function (event) {
+ var source = event.target || event.srcElement;
+ event.stopPropagation();
+ if(!( $(source).is("button") || $(source).is("input") )){
+ var opened = $(this).prop("open");
+ if (opened && opened.match("opened")) {
+ $(this).prop("open", "closed");
+ $(this).find("span.listclose").removeClass("listclose").addClass("listopen");
+ #table_var#.fnClose(this);
+ } else {
+ $(this).prop("open", "opened");
+ $(this).find("span.listopen").removeClass("listopen").addClass("listclose");
+ var jsid = $(this).attr("jsuuid");
+ var node = $(this).attr("nodeid");
+ var ajaxParam = JSON.stringify({"jsid":jsid , "id":$(this).attr("nodeid") , "status":$(this).attr("nodeStatus")});
+ #table_var#.fnOpen( this, fnFormatDetails(jsid), 'details' );
+ %s;
+ }
}
} );
- })
+ } )
""".format(
SHtml.ajaxCall(JsVar("ajaxParam"), details _)._2.toJsCmd).replaceAll("#table_var#",
jsVarNameForId(tableId))

0 comments on commit 2949234

Please sign in to comment.