Prevent widget's click events to propagate
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 5 Aug 2013 14:47:28 +0000 (16:47 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 5 Aug 2013 14:47:28 +0000 (16:47 +0200)
modules/documentCanvas/canvas/widgets.js

index cedf16d..570bd0b 100644 (file)
@@ -17,7 +17,8 @@ return {
             .css('display', 'inline')
             .show();
 
             .css('display', 'inline')
             .show();
 
-        mydom.click(function() {
+        mydom.click(function(e) {
+            e.stopPropagation();
             clickHandler();
         });
 
             clickHandler();
         });
 
@@ -27,7 +28,10 @@ return {
     hideButton: function(clickHandler) {
         var mydom = $('<span>x</span>')
             .addClass('canvas-widget canvas-widget-hide-button');
     hideButton: function(clickHandler) {
         var mydom = $('<span>x</span>')
             .addClass('canvas-widget canvas-widget-hide-button');
-        mydom.click(clickHandler);
+        mydom.click(function(e) {
+            e.stopPropagation();
+            clickHandler();
+        });
         return mydom;
     }
 
         return mydom;
     }