-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spinner: Deprecate _uiSpinnerHtml and _buttonHtml extension points
Fixes #11097
- Loading branch information
Showing
4 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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,35 @@ | ||
define( [ | ||
"lib/common", | ||
"ui/spinner" | ||
], function( common ) { | ||
|
||
common.testWidget( "spinner", { | ||
defaults: { | ||
classes: { | ||
"ui-spinner": "ui-corner-all", | ||
"ui-spinner-up": "ui-corner-tr", | ||
"ui-spinner-down": "ui-corner-br" | ||
}, | ||
culture: null, | ||
disabled: false, | ||
icons: { | ||
down: "ui-icon-triangle-1-s", | ||
up: "ui-icon-triangle-1-n" | ||
}, | ||
incremental: true, | ||
max: null, | ||
min: null, | ||
numberFormat: null, | ||
page: 10, | ||
step: 1, | ||
|
||
// callbacks | ||
change: null, | ||
create: null, | ||
spin: null, | ||
start: null, | ||
stop: null | ||
} | ||
}); | ||
|
||
} ); |
This file contains 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,21 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>jQuery UI Spinner Test Suite</title> | ||
|
||
<script src="../../../external/requirejs/require.js"></script> | ||
<script src="../../lib/css.js" data-modules="core button spinner"></script> | ||
<script src="../../lib/bootstrap.js" data-widget="spinner" data-deprecated="true"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"> | ||
|
||
<input id="spin" class="foo"> | ||
<input id="spin2" value="2"> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains 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,41 @@ | ||
define( [ | ||
"jquery", | ||
"ui/spinner" | ||
], function( $, testHelper ) { | ||
|
||
var originalSpinner = $.ui.spinner.prototype; | ||
module( "spinner: deprecated", { | ||
setup: function() { | ||
$.widget( "ui.spinner", $.ui.spinner, { | ||
_uiSpinnerHtml: function() { | ||
return "<span class='spin-wrap'>"; | ||
}, | ||
|
||
_buttonHtml: function() { | ||
return "" + | ||
"<a class='spin-up'>" + | ||
"<span>▲</span>" + | ||
"</a>" + | ||
"<a>" + | ||
"<span>▼</span>" + | ||
"</a>"; | ||
} | ||
} ); | ||
}, | ||
|
||
teardown: function() { | ||
$.ui.spinner.prototype = originalSpinner; | ||
} | ||
} ); | ||
|
||
test( "markup structure - custom", function( assert ) { | ||
expect( 2 ); | ||
var element = $( "#spin" ).spinner(), | ||
spinner = element.spinner( "widget" ), | ||
up = spinner.find( ".ui-spinner-up" ); | ||
|
||
assert.hasClasses( spinner, "ui-spinner ui-widget ui-widget-content spin-wrap", "_uiSpinnerHtml overides default markup" ); | ||
assert.hasClasses( up, "ui-spinner-button ui-spinner-up ui-widget spin-up", "_uiButtonHtml overides default markup" ); | ||
} ); | ||
|
||
} ); |
This file contains 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