Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/298457
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/mediawiki/MediaWikiTheme.js
3 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/57/298457/1
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/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();
--
To view, visit https://gerrit.wikimedia.org/r/298457
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I00eaa2b815d7c76b6315a3993a9a7921ae503c00
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits