Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set the custom clearSearchButtonText in a timing independent way

  • Loading branch information...
commit 2321c2cc9418db6dfdcf11c50f470db35eeaf53c 1 parent a005fb4
@johnbender johnbender authored
View
11 tests/unit/textinput/index.html
@@ -11,13 +11,10 @@
<script src="../../../tests/jquery.testHelper.js"></script>
<script>
$.testHelper.asyncLoad([
- [
- "jquery.mobile.forms.textinput"
- ],
+ [ "jquery.mobile.forms.textinput" ],
+ [ "settings.js" ],
[ "jquery.mobile.init" ],
- [
- "textinput_core.js"
- ]
+ [ "textinput_core.js" ]
]);
</script>
@@ -56,7 +53,7 @@ <h2 id="qunit-userAgent"></h2>
<textarea id="keyup-autogrow">
</textarea>
<a href="external.html" id="external">external</a>
-
+
<input type="search" id="search-input">
</div>
</body>
View
3  tests/unit/textinput/settings.js
@@ -0,0 +1,3 @@
+$( document ).bind("mobileinit", function(){
+ $.mobile.textinput.prototype.options.clearSearchButtonText = "custom value";
+});
View
7 tests/unit/textinput/textinput_core.js
@@ -58,10 +58,9 @@
}
]);
});
-
- $.mobile.textinput.prototype.options.clearSearchButtonText = "custom value";
-
- test( "\"clear text\" button for search inputs should use configured text", function(){
+
+ // NOTE init binding to alter the setting is in settings.js
+ test( "'clear text' button for search inputs should use configured text", function(){
strictEqual( $( "#search-input" ).closest( ".ui-input-search" ).find( ".ui-input-clear" ).attr( "title" ), "custom value" );
});
})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.