github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 920
    • 212
  • Source
  • Commits
  • Network (212)
  • Graphs
  • Tree: c5770c0

click here to add a description

click here to add a homepage

  • Switch Branches (8)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
    • widget-super
  • Switch Tags (21)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.4
    • 1.8.3
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Dialog: modified so that minWidth is respected. Fixes #5531 - dialog width should be at least minWidth on creation.
Ziling Zhao (author)
Mon Apr 19 15:42:34 -0700 2010
scottgonzalez (committer)
Fri Jul 30 12:14:48 -0700 2010
commit  c5770c0e84b786ebe55a
tree    e9e379ad55242652119f
parent  90caa93a9b4b9b894b05
M tests/unit/dialog/dialog_tickets.js 21 •••••
M ui/jquery.ui.dialog.js 4 ••••
Txt tests/unit/dialog/dialog_tickets.js
  • View file @ c5770c0
... ...
@@ -40,4 +40,25 @@ test("#5184: isOpen in dialogclose event is true", function() {
40 40
   el.remove();
41 41
 });
42 42
 
  43
+test("#5531: dialog width should be at least minWidth on creation", function () {
  44
+    el = $('<div></div>').dialog({
  45
+            width: 200,
  46
+            minWidth: 300
  47
+        });
  48
+
  49
+    equals(el.dialog('option', 'width'), 300, "width is minWidth");
  50
+    el.dialog('option', 'width', 200);
  51
+    equals(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth");
  52
+    el.dialog('option', 'width', 320);
  53
+    equals(el.dialog('option', 'width'), 320, "width changed if set to > minWidth");
  54
+    el.remove();
  55
+
  56
+    el = $('<div></div>').dialog({
  57
+            minWidth: 300
  58
+        });
  59
+    ok(el.dialog('option', 'width') >=  300, "width is at least 300");
  60
+    el.remove();
  61
+
  62
+});
  63
+
43 64
 })(jQuery);
Txt ui/jquery.ui.dialog.js
  • View file @ c5770c0
... ...
@@ -628,6 +628,10 @@ $.widget("ui.dialog", {
628 628
       height: 0
629 629
     });
630 630
 
  631
+    if (options.minWidth > options.width) {
  632
+      options.width = options.minWidth;
  633
+    }
  634
+
631 635
     // reset wrapper sizing
632 636
     // determine the height of all the non-content elements
633 637
     nonContentHeight = this.uiDialog.css({

0 notes on commit c5770c0

Please log in to comment.
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文