From cb36e97c076abea10e8802b3037612511af8fdd8 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 5 Mar 2014 00:45:08 -0300 Subject: [PATCH] Rename web2d fire event. --- mindplot/src/main/javascript/NodeGraph.js | 3 +-- web2d/src/main/javascript/Element.js | 4 ++-- web2d/src/main/javascript/peer/svg/ElementPeer.js | 2 +- web2d/src/test/javascript/mootools-core-1.4.5.js | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mindplot/src/main/javascript/NodeGraph.js b/mindplot/src/main/javascript/NodeGraph.js index 77cffe74..73da92a2 100644 --- a/mindplot/src/main/javascript/NodeGraph.js +++ b/mindplot/src/main/javascript/NodeGraph.js @@ -24,7 +24,6 @@ mindplot.NodeGraph = new Class({ this._mouseEvents = true; this.setModel(nodeModel); this._onFocus = false; - this._event = new Events(); this._size = {width:50,height:20}; }, @@ -67,7 +66,7 @@ mindplot.NodeGraph = new Class({ fireEvent: function(type, event) { var elem = this.get2DElement(); - elem.fireEvent(type, event); + elem.toggle(type, event); }, setMouseEventsEnabled : function(isEnabled) { diff --git a/web2d/src/main/javascript/Element.js b/web2d/src/main/javascript/Element.js index 0fa9ca84..5394267f 100644 --- a/web2d/src/main/javascript/Element.js +++ b/web2d/src/main/javascript/Element.js @@ -87,8 +87,8 @@ web2d.Element = new Class({ this._peer.addEvent(type, listener); }, - fireEvent : function(type, event) { - this._peer.fireEvent(type, event); + toggle : function(type, event) { + this._peer.toggle(type, event); }, cloneEvents : function(from) { diff --git a/web2d/src/main/javascript/peer/svg/ElementPeer.js b/web2d/src/main/javascript/peer/svg/ElementPeer.js index ec91ba88..587ad7a4 100644 --- a/web2d/src/main/javascript/peer/svg/ElementPeer.js +++ b/web2d/src/main/javascript/peer/svg/ElementPeer.js @@ -89,7 +89,7 @@ web2d.peer.svg.ElementPeer = new Class({ $(this._native).bind(type, listener); }, - fireEvent:function (type, event) { + toggle:function (type, event) { $(this._native).toggle(type, event); }, diff --git a/web2d/src/test/javascript/mootools-core-1.4.5.js b/web2d/src/test/javascript/mootools-core-1.4.5.js index 59fe1b1c..dcd9d14a 100644 --- a/web2d/src/test/javascript/mootools-core-1.4.5.js +++ b/web2d/src/test/javascript/mootools-core-1.4.5.js @@ -118,7 +118,7 @@ return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; -},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +},toggle:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); }},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; },removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; }var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments));