Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230294

Change subject: Context emits visible events
......................................................................

Context emits visible events

This will allow mobile to know when the toolbar has changed height.

Change-Id: I1ab29d74b6743b5bc82e97ef3bd98d62c7e81b9a
---
M src/ui/ve.ui.Context.js
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/94/230294/1

diff --git a/src/ui/ve.ui.Context.js b/src/ui/ve.ui.Context.js
index 5f8d72b..d805034 100644
--- a/src/ui/ve.ui.Context.js
+++ b/src/ui/ve.ui.Context.js
@@ -10,6 +10,7 @@
  * @class
  * @abstract
  * @extends OO.ui.Element
+ * @mixins OO.EventEmitter
  * @mixins OO.ui.mixin.GroupElement
  *
  * @constructor
@@ -21,6 +22,7 @@
        ve.ui.Context.super.call( this, config );
 
        // Mixin constructors
+       OO.EventEmitter.call( this );
        OO.ui.mixin.GroupElement.call( this, config );
 
        // Properties
@@ -41,7 +43,16 @@
 
 OO.inheritClass( ve.ui.Context, OO.ui.Element );
 
+OO.mixinClass( ve.ui.Context, OO.EventEmitter );
+
 OO.mixinClass( ve.ui.Context, OO.ui.mixin.GroupElement );
+
+/* Events */
+
+/**
+ * @event visible
+ * @param {boolean} visible The context is visible
+ */
 
 /* Static Property */
 
@@ -194,6 +205,7 @@
                this.visible = show;
                this.$element.toggleClass( 'oo-ui-element-hidden', 
!this.visible );
        }
+       this.emit( 'toggle', this.visible );
        return $.Deferred().resolve().promise();
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/230294
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ab29d74b6743b5bc82e97ef3bd98d62c7e81b9a
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to