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

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 946
    • 223
  • Source
  • Commits
  • Network (223)
  • Graphs
  • Tree: 79ee6f0

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: When using the title attribute, update the title option. Fixes #5877 - Dialog: when using the title attribute, the title option should be updated.
scottgonzalez (author)
Fri Aug 27 15:02:11 -0700 2010
commit  79ee6f0d7b94b71d89f3
tree    f8d7cdf363a80371ab04
parent  af9864dcc439bf8d04f4
M tests/unit/dialog/dialog_options.js 6 ••••
M ui/jquery.ui.dialog.js 3 •••
Txt tests/unit/dialog/dialog_options.js
  • View file @ 79ee6f0
... ...
@@ -369,7 +369,7 @@ test("stack", function() {
369 369
 });
370 370
 
371 371
 test("title", function() {
372  
-  expect(5);
  372
+  expect(9);
373 373
 
374 374
   function titleText() {
375 375
     return dlg().find(".ui-dialog-title").html();
... ...
@@ -377,18 +377,22 @@ test("title", function() {
377 377
 
378 378
   el = $('<div></div>').dialog();
379 379
     equals(titleText(), "&nbsp;", "[default]");
  380
+    equals(el.dialog("option", "title"), "", "option not changed");
380 381
   el.remove();
381 382
 
382 383
   el = $('<div title="foo"/>').dialog();
383 384
     equals(titleText(), "foo", "title in element attribute");
  385
+    equals(el.dialog("option", "title"), "foo", "option updated from attribute");
384 386
   el.remove();
385 387
 
386 388
   el = $('<div></div>').dialog({ title: 'foo' });
387 389
     equals(titleText(), "foo", "title in init options");
  390
+    equals(el.dialog("option", "title"), "foo", "opiton set from options hash");
388 391
   el.remove();
389 392
 
390 393
   el = $('<div title="foo"/>').dialog({ title: 'bar' });
391 394
     equals(titleText(), "bar", "title in init options should override title in element attribute");
  395
+    equals(el.dialog("option", "title"), "bar", "opiton set from options hash");
392 396
   el.remove();
393 397
 
394 398
   el = $('<div></div>').dialog().dialog('option', 'title', 'foo');
Txt ui/jquery.ui.dialog.js
  • View file @ 79ee6f0
... ...
@@ -67,10 +67,11 @@ $.widget("ui.dialog", {
67 67
       this.originalTitle = "";
68 68
     }
69 69
 
  70
+    this.options.title = this.options.title || this.originalTitle;
70 71
     var self = this,
71 72
       options = self.options,
72 73
 
73  
-      title = options.title || self.originalTitle || '&#160;',
  74
+      title = options.title || '&#160;',
74 75
       titleId = $.ui.dialog.getTitleId(self.element),
75 76
 
76 77
       uiDialog = (self.uiDialog = $('<div></div>'))

0 notes on commit 79ee6f0

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
  • 中文