Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Demos: Update search to use window.location instead of changePage to …
Browse files Browse the repository at this point in the history
…ajax nav. Fixes #6623 - Demo page(master): A search feature of Demo page for master is abnormal operating.
  • Loading branch information
arschmitz committed Nov 18, 2013
1 parent decbb59 commit 3ff32c1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions demos/_assets/js/jqm-demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,15 @@ $( document ).on( "mobileinit", function() {

},
submitTo: function() {
var form = this.element.parent().find( "form" );
var url,
form = this.element.parent().find( "form" );

form.attr( "method", "get" )
.attr( "action", this.options.submitTo );

var url = this.options.submitTo + "?search=" + this.element.parent().find( "input" ).val();
url = this.options.submitTo + "?search=" + this.element.parent().find( "input" ).val();

$( ":mobile-pagecontainer" ).pagecontainer( "change", url );
window.location = url;
},
enterToNav: function() {
var form = this.element.parent().find( "form" );
Expand Down Expand Up @@ -243,10 +244,11 @@ $( document ).on( "mobileinit", function() {
}
},
handleKeyUp: function( e ) {
var input = this.element.prev("form").find( "input" );
var search,
input = this.element.prev("form").find( "input" );

if ( e.which === $.ui.keyCode.DOWN ) {
if ( this.element.find( "li.ui-btn-active" ).length == 0 ) {
if ( this.element.find( "li.ui-btn-active" ).length === 0 ) {
this.element.find( "li:first" ).toggleClass( "ui-btn-active" ).find("a").toggleClass( "ui-btn-active" );
} else {
this.element.find( "li.ui-btn-active a" ).toggleClass( "ui-btn-active");
Expand All @@ -266,7 +268,7 @@ $( document ).on( "mobileinit", function() {
this.element.find( "li.ui-btn-active" ).removeClass( "ui-btn-active" );

if ( this.options.highlight ) {
var search = input.val();
search = input.val();

this.element.find( "li" ).each(function() {
$( this ).removeHighlight();
Expand Down

0 comments on commit 3ff32c1

Please sign in to comment.