-
Notifications
You must be signed in to change notification settings - Fork 5.3k
All: Classes Option #1369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
All: Classes Option #1369
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
891a7d9
Widget: add the _classes method.
petersendidit 6a6446b
Tabs: use the _classes method.
petersendidit 07f52c1
Dialog: use the _classes method.
petersendidit f8c5aea
Accordion: use the _classes method.
petersendidit 544f9ff
Autocomplete: use the _classes method.
petersendidit 3c52f19
Slider: use the _classes method.
petersendidit b1c0f22
Spinner: use the _classes method.
petersendidit 43ec02b
Progressbar: use the _classes method.
petersendidit 51d1d33
Menu: use the _classes method.
petersendidit 0aa2e1f
Tooltip: use the _classes method.
petersendidit 9562d7a
Selectmenu: use the _classes method.
petersendidit 808bb7f
Widget: Process "classes" option during _setOption()
a813056
Widget: Avoid adding extra spaces to the result of this._classes(...)
330dc7e
Widget: Add tests for classes option setting
arschmitz 157ba04
Autocomplete: Implement _elementsFromFromClassKey()
8c0b1ac
Accordion: Implementing _elementsFromClassKey()
dfaba1d
Dialog: Add support for setOption with classes
arschmitz af57abd
Menu: Add support for setOption with classes
arschmitz aa4bbb3
Progressbar: Add support for setOption with classes
arschmitz e59c360
Selectmenu: Add support for setOption with classes
arschmitz d93e475
Slider: Add support for setOption with classes
arschmitz 31dcc86
Spinner: Add support for setOption with classes
arschmitz 2a0b8eb
Tabs: Add support for setOption with classes
arschmitz 69bdbfc
Tooltip: Add support for setOption with classes
arschmitz b238f36
Accordion: Update classes option to use empty string instead of null
arschmitz c31c9f1
Autocomplete: Update classes option to use empty string instead of null
arschmitz 9ab23dc
Dialog: Update classes option to use empty string instead of null
arschmitz c5ada6d
Menu: Update classes option to use empty string instead of null
arschmitz 98a2cc7
Progressbar: Update classes option to use empty string instead of null
arschmitz 7c7acda
Slider: Update classes option to use empty string instead of null
arschmitz 836feb5
Spinner: Update classes option to use empty string instead of null
arschmitz b97ff0e
Tabs: Update classes option to use empty string instead of null
arschmitz 5dd9120
Tooltip: Update classes option to use empty string instead of null
arschmitz e183631
Dialog: Fix checking of $.uiBackcompat in tests
arschmitz 7628f28
Tooltip: Update checking of $.uiBackcompat in tests
arschmitz cecd4e2
Dialog: Simplify tests for classes
arschmitz 328308a
Accordion: Simplify tests for classes
arschmitz 758ff6c
Menu: Simplify tests for classes
arschmitz 21fbfa3
Progressbar: simplify tests for classes
arschmitz 7382fd3
Selectmenu: Simplify tests for classes
arschmitz 3ac52a8
Slider: Simplify tests for classes
arschmitz ab96209
Tabs: Simplify tests for classes
arschmitz 0fec7d4
Selectmenu: Remove unneeded comment
arschmitz ef9ed64
Tooltip: Remove deprecated tooltip class replaces with classes option
arschmitz 913edd3
Autocomplete: Remove use of deprecated tooltipClass option in demo
arschmitz a0b707b
Menu: Update for menu wrapper
arschmitz 7a3eaa8
Menu: fix incorrect default classes value
arschmitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
TestHelpers.commonWidgetTests( "dialog", { | ||
defaults: { | ||
appendTo: "body", | ||
autoOpen: true, | ||
buttons: [], | ||
classes: { | ||
"ui-dialog": "ui-corner-all", | ||
"ui-dialog-content": "", | ||
"ui-dialog-titlebar": "ui-corner-all", | ||
"ui-dialog-titlebar-close": "", | ||
"ui-dialog-title": "", | ||
"ui-dialog-buttons": "", | ||
"ui-dialog-buttonpane": "", | ||
"ui-dialog-buttonset": "", | ||
"ui-dialog-dragging": "", | ||
"ui-dialog-resizing": "", | ||
"ui-widget-overlay": "" | ||
}, | ||
closeOnEscape: true, | ||
closeText: "close", | ||
dialogClass: "", | ||
disabled: false, | ||
draggable: true, | ||
height: "auto", | ||
hide: null, | ||
maxHeight: null, | ||
maxWidth: null, | ||
minHeight: 150, | ||
minWidth: 150, | ||
modal: false, | ||
position: { | ||
my: "center", | ||
at: "center", | ||
of: window, | ||
collision: "fit", | ||
using: $.ui.dialog.prototype.options.position.using | ||
}, | ||
resizable: true, | ||
show: null, | ||
title: null, | ||
width: 300, | ||
|
||
// callbacks | ||
beforeClose: null, | ||
close: null, | ||
create: null, | ||
drag: null, | ||
dragStart: null, | ||
dragStop: null, | ||
focus: null, | ||
open: null, | ||
resize: null, | ||
resizeStart: null, | ||
resizeStop: null | ||
} | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>jQuery UI Dialog Test Suite</title> | ||
|
||
<script src="../../jquery.js"></script> | ||
<link rel="stylesheet" href="../../../external/qunit/qunit.css"> | ||
<script src="../../../external/qunit/qunit.js"></script> | ||
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script> | ||
<script src="../testsuite.js"></script> | ||
<script> | ||
TestHelpers.loadResources({ | ||
css: [ "core", "dialog" ], | ||
js: [ | ||
"ui/core.js", | ||
"ui/widget.js", | ||
"ui/position.js", | ||
"ui/mouse.js", | ||
"ui/draggable.js", | ||
"ui/resizable.js", | ||
"ui/button.js", | ||
"ui/effect.js", | ||
"ui/effect-blind.js", | ||
"ui/effect-clip.js", | ||
"ui/effect-explode.js", | ||
"ui/dialog.js" | ||
] | ||
}); | ||
</script> | ||
|
||
<script src="dialog_common_derecated.js"></script> | ||
<script src="dialog_core.js"></script> | ||
<script src="dialog_events.js"></script> | ||
<script src="dialog_methods.js"></script> | ||
<script src="dialog_options.js"></script> | ||
<script src="dialog_deprecated.js"></script> | ||
<script src="dialog_test_helpers.js"></script> | ||
|
||
<script src="../swarminject.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"> | ||
<div id="dialog1"></div> | ||
<div id="dialog2"></div> | ||
<div id="form-dialog" title="Profile Information"> | ||
<!-- create a spacer to ensure there's enough space to scroll --> | ||
<div style="height: 250px;">...</div> | ||
<fieldset> | ||
<legend>Please share some personal information</legend> | ||
<label for="favorite-animal">Your favorite animal</label><input id="favorite-animal"> | ||
<label for="favorite-color">Your favorite color</label><input id="favorite-color"> | ||
</fieldset> | ||
<div role="group" aria-describedby="section2"> | ||
<p id="section2">Some more (optional) information</p> | ||
<label for="favorite-food">Favorite food</label><input id="favorite-food"> | ||
</div> | ||
</div> | ||
<div class="wrap" id="wrap1"></div> | ||
<div class="wrap" id="wrap2"></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* dialog_deprecated.js | ||
*/ | ||
(function( $ ) { | ||
|
||
module( "dialog (deprecated): options" ); | ||
|
||
test( "dialogClass", function() { | ||
expect( 6 ); | ||
|
||
var element = $( "<div></div>" ).dialog(), | ||
widget = element.dialog( "widget" ); | ||
equal( widget.is( ".foo" ), false, "dialogClass not specified. class not added" ); | ||
element.remove(); | ||
|
||
element = $( "<div></div>" ).dialog({ dialogClass: "foo" }); | ||
widget = element.dialog( "widget" ); | ||
equal( widget.is( ".foo" ), true, "dialogClass in init. foo class added"); | ||
element.dialog( "option", "dialogClass", "foobar" ); | ||
equal( widget.is( ".foo" ), false, "dialogClass changed, previous one was removed" ); | ||
equal( widget.is( ".foobar" ), true, "dialogClass changed, new one was added" ); | ||
element.remove(); | ||
|
||
element = $( "<div></div>" ).dialog({ dialogClass: "foo bar" }); | ||
widget = element.dialog( "widget" ); | ||
equal( widget.is( ".foo" ), true, "dialogClass in init, two classes. foo class added" ); | ||
equal( widget.is( ".bar" ), true, "dialogClass in init, two classes. bar class added" ); | ||
element.remove(); | ||
}); | ||
|
||
})( jQuery ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this assertion accomplish?
Also missing space after the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @petersendidit can answer this i'm not sure and he added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At one point I was on a quest to write tests to make sure that all widgets correctly cleaned up after themselves when they were destroyed. There were a few widgets that didn't correctly remove all of their classes. Can't remember if dialog was one of them or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the other two assertions don't set the buttons option and that adds more markup, keeping this addition is fine.