Merge branch 'MDL-43262-master' of git://github.com/andrewnicols/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 13 Jan 2014 04:11:17 +0000 (12:11 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 13 Jan 2014 04:11:17 +0000 (12:11 +0800)
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js
lib/yui/src/notification/js/dialogue.js

index b4b62ea..03db8ff 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js and b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js differ
index b289ee5..bd8741d 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js and b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js differ
index 77dc52d..e732028 100644 (file)
Binary files a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js and b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue.js differ
index ae4a4d4..29fa7c4 100644 (file)
@@ -39,15 +39,8 @@ DIALOGUE = function(c) {
     }
 
     config.srcNode =    '#'+id;
-    config.width =      config.width || '400px';
-    config.center =     config.centered && true;
-    config.centered =   false;
     config.COUNT = COUNT;
 
-    if (config.width === 'auto') {
-        delete config.width;
-    }
-
     // closeButton param to keep the stable versions API.
     if (config.closeButton === false) {
         config.buttons = null;
@@ -448,4 +441,61 @@ Y.extend(DIALOGUE, Y.Panel, {
     }
 });
 
+Y.Base.modifyAttrs(DIALOGUE, {
+    /**
+     * String with units, or number, representing the width of the Widget.
+     * If a number is provided, the default unit, defined by the Widgets
+     * DEF_UNIT, property is used.
+     *
+     * If a value of 'auto' is used, then an empty String is instead
+     * returned.
+     *
+     * @attribute width
+     * @default '400px'
+     * @type {String|Number}
+     */
+    width: {
+        value: '400px',
+        setter: function(value) {
+            if (value === 'auto') {
+                return '';
+            }
+            return value;
+        }
+    },
+
+    /**
+     * Boolean indicating whether or not the Widget is visible.
+     *
+     * We override this from the default Widget attribute value.
+     *
+     * @attribute visible
+     * @default false
+     * @type Boolean
+     */
+    visible: {
+        value: false
+    },
+
+    /**
+     * A convenience Attribute, which can be used as a shortcut for the
+     * `align` Attribute.
+     *
+     * Note: We override this in Moodle such that it sets a value for the
+     * `center` attribute if set. The `centered` will always return false.
+     *
+     * @attribute centered
+     * @type Boolean|Node
+     * @default false
+     */
+    centered: {
+        setter: function(value) {
+            if (value) {
+                this.set('center', true);
+            }
+            return false;
+        }
+    }
+});
+
 M.core.dialogue = DIALOGUE;