can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r10820: LJSUP-9435, LJSUP-9433: Buble for delete...

Committer: dpetrov
LJSUP-9435, LJSUP-9433: Buble for delete user should disappear, Buble for delete user need to float
U   trunk/htdocs/js/jquery/jquery.lj.basicWidget.js
U   trunk/htdocs/js/jquery/jquery.lj.sidePane.js
Modified: trunk/htdocs/js/jquery/jquery.lj.basicWidget.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.basicWidget.js	2011-08-09 07:25:54 UTC (rev 10819)
+++ trunk/htdocs/js/jquery/jquery.lj.basicWidget.js	2011-08-09 07:44:14 UTC (rev 10820)
@@ -45,6 +45,13 @@
 			tmpl: {}
 		},
 
+		_create: function() {
+			/**
+			 * {Object} Contains all events that should not trigger events on next fire for this widget.
+			 */
+			this.__suppressedEvents = {};
+		},
+
 		/**
 		 * Bind common events for the widget
 		 */
@@ -115,12 +122,29 @@
 
 				while( cbs[ ++i ] ) {
 					if( !includeOwner && cbs[ i ].owner === this ) { continue; }
+					if( type in cbs[ i ].owner.__suppressedEvents ) { continue; }
 					cbs[ i ].fn.apply( null, args );
 				}
+
+				//we delete supressed event flag only after firing event because 
+				//wedget can subscribe more than one callback
+				while(cbs[ --i ]) {
+					if( type in cbs[ i ].owner.__suppressedEvents ) {
+						delete cbs[ i ].owner.__suppressedEvents[ type ];
+					}
+				}
 			}
 		},
 
 		/**
+		 * Prevent event from being trigger on this widget instance on next fire.
+		 *     An event after next will be processed as normal
+		 */
+		_suppressNextEvent: function( eventName ) {
+			this.__suppressedEvents[ eventName ] = true;
+		},
+
+		/**
 		 * Remove all subscriptions on widget distruction. If overriden, this method should be
 		 *     also caled.
 		 */

Modified: trunk/htdocs/js/jquery/jquery.lj.sidePane.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.sidePane.js	2011-08-09 07:25:54 UTC (rev 10819)
+++ trunk/htdocs/js/jquery/jquery.lj.sidePane.js	2011-08-09 07:44:14 UTC (rev 10820)
@@ -17,7 +17,7 @@
  */
 (function( $ ) {
 
-	//@TODO: move this to the external file.
+	// @TODO: move this to the external file.
 	var transitionsSupported = function() {
 		var div = document.createElement('div');
 
@@ -197,6 +197,9 @@
 							.removeClass( widget.options.classNames.open );
 
 						widget.element.removeAttr( 'style' );
+						if (widget.options.visibility === 'hidden') {
+							widget.hide();
+						}
 					}
 				} );
 			}

Tags: can3p, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments