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

Commit

Permalink
Demos: Fix jscs errors in search js
Browse files Browse the repository at this point in the history
  • Loading branch information
apsdehal committed Mar 20, 2016
1 parent 4e6f819 commit 60a0d79
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions demos/_assets/js/jqm-demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,24 @@ $( document ).on( "mobileinit", function() {

if ( e.which === $.ui.keyCode.DOWN ) {
if ( this.element.find( "li.ui-listview-item-active" ).length === 0 ) {
this.element.find( "li:not('.ui-screen-hidden'):first" )
this.element.find( "li" )
.not( ".ui-screen-hidden" )
.first()
.toggleClass( "ui-listview-item-active" )
.find("a").toggleClass( "ui-button-active" );
.find( "a" )
.toggleClass( "ui-button-active" );
} else {
this.element.find( "li.ui-listview-item-active a" )
.toggleClass( "ui-button-active");

this.element.find( "li.ui-listview-item-active" )
.toggleClass( "ui-listview-item-active" )
.nextAll("li:not('.ui-screen-hidden'):first")
.nextAll( "li" )
.not( ".ui-screen-hidden" )
.first()
.toggleClass( "ui-listview-item-active" )
.find("a").toggleClass( "ui-button-active" );
.find( "a" )
.toggleClass( "ui-button-active" );
}
} else if ( e.which === $.ui.keyCode.UP ) {
if ( this.element.find( "li.ui-listview-item-active" ).length !== 0 ) {
Expand All @@ -336,13 +342,19 @@ $( document ).on( "mobileinit", function() {

this.element.find( "li.ui-listview-item-active" )
.toggleClass( "ui-listview-item-active" )
.prevAll("li:not('.ui-screen-hidden'):first")
.prevAll( "li" )
.not( ".ui-screen-hidden" )
.first()
.toggleClass( "ui-listview-item-active" )
.find("a").toggleClass( "ui-button-active" );
.find( "a" )
.toggleClass( "ui-button-active" );
} else {
this.element.find( "li:not('.ui-screen-hidden'):last" )
this.element.find( "li" )
.not( ".ui-screen-hidden" )
.last()
.toggleClass( "ui-listview-item-active" )
.find("a").toggleClass( "ui-button-active" );
.find( "a" )
.toggleClass( "ui-button-active" );
}
} else if ( e.which === $.ui.keyCode.ENTER ) {
this.submitHandler();
Expand Down

0 comments on commit 60a0d79

Please sign in to comment.