Permalink
Browse files

set the custom clearSearchButtonText in a timing independent way

  • Loading branch information...
1 parent a005fb4 commit 2321c2cc9418db6dfdcf11c50f470db35eeaf53c @johnbender johnbender committed Apr 5, 2012
Showing with 10 additions and 11 deletions.
  1. +4 −7 tests/unit/textinput/index.html
  2. +3 −0 tests/unit/textinput/settings.js
  3. +3 −4 tests/unit/textinput/textinput_core.js
@@ -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>
@@ -0,0 +1,3 @@
+$( document ).bind("mobileinit", function(){
+ $.mobile.textinput.prototype.options.clearSearchButtonText = "custom value";
+});
@@ -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);

0 comments on commit 2321c2c

Please sign in to comment.