jenkins-bot has submitted this change and it was merged.

Change subject: Add dialog transition duration to theme JS file
......................................................................


Add dialog transition duration to theme JS file

This will allow users to set code to run when the
dialog is fully rendered and sized, without having to
hard code a theme specific value.

Bug: T67254
Change-Id: I00eaa2b815d7c76b6315a3993a9a7921ae503c00
---
M src/Theme.js
M src/themes/apex/ApexTheme.js
M src/themes/apex/common.less
M src/themes/mediawiki/MediaWikiTheme.js
M src/themes/mediawiki/common.less
5 files changed, 30 insertions(+), 0 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/src/Theme.js b/src/Theme.js
index 8a7ad7f..dd5cebf 100644
--- a/src/Theme.js
+++ b/src/Theme.js
@@ -54,3 +54,15 @@
                .removeClass( classes.off.join( ' ' ) )
                .addClass( classes.on.join( ' ' ) );
 };
+
+/**
+ * Get the transition duration in milliseconds for dialogs opening/closing
+ *
+ * The dialog should be fully rendered this many milliseconds after the
+ * ready process has executed.
+ *
+ * @return {number} Transition duration in milliseconds
+ */
+OO.ui.Theme.prototype.getDialogTransitionDuration = function () {
+       return 0;
+};
diff --git a/src/themes/apex/ApexTheme.js b/src/themes/apex/ApexTheme.js
index b84ae06..30674f1 100644
--- a/src/themes/apex/ApexTheme.js
+++ b/src/themes/apex/ApexTheme.js
@@ -13,6 +13,15 @@
 
 OO.inheritClass( OO.ui.ApexTheme, OO.ui.Theme );
 
+/* Methods */
+
+/**
+ * @inheritdoc
+ */
+OO.ui.ApexTheme.prototype.getDialogTransitionDuration = function () {
+       return 250;
+};
+
 /* Instantiation */
 
 OO.ui.theme = new OO.ui.ApexTheme();
diff --git a/src/themes/apex/common.less b/src/themes/apex/common.less
index 125f2d1..76f77ea 100644
--- a/src/themes/apex/common.less
+++ b/src/themes/apex/common.less
@@ -28,6 +28,7 @@
 @border-radius-default: 0.25em;
 
 // Theme animation variables
+// Some of these values are duplicated in OO.ui.ApexTheme
 @quick-ease: 100ms ease;
 @medium-ease: 250ms ease;
 @slow-ease: 500ms ease;
diff --git a/src/themes/mediawiki/MediaWikiTheme.js 
b/src/themes/mediawiki/MediaWikiTheme.js
index 49641d1..ecf53e8 100644
--- a/src/themes/mediawiki/MediaWikiTheme.js
+++ b/src/themes/mediawiki/MediaWikiTheme.js
@@ -58,6 +58,13 @@
        return classes;
 };
 
+/**
+ * @inheritdoc
+ */
+OO.ui.MediaWikiTheme.prototype.getDialogTransitionDuration = function () {
+       return 250;
+};
+
 /* Instantiation */
 
 OO.ui.theme = new OO.ui.MediaWikiTheme();
diff --git a/src/themes/mediawiki/common.less b/src/themes/mediawiki/common.less
index 9229176..4ad1c4f 100644
--- a/src/themes/mediawiki/common.less
+++ b/src/themes/mediawiki/common.less
@@ -63,6 +63,7 @@
 @text-shadow-disabled: @text-shadow-default;
 
 // Transition variables
+// Some of these values are duplicated in OO.ui.MediaWikiTheme
 @transition-ease-quick: 100ms; // `ease` is the initial value
 @transition-ease-medium: 250ms;
 @transition-ease-out-back-medium: 200ms cubic-bezier( 0.175, 0.885, 0.32, 
1.275 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I00eaa2b815d7c76b6315a3993a9a7921ae503c00
Gerrit-PatchSet: 2
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to