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 e4bb2c5
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 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,17 +342,23 @@ $( 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();
}else if ( typeof e.which !== "undefined" ) {
} else if ( typeof e.which !== "undefined" ) {
this.element.find( "li.ui-listview-item-active" )
.removeClass( "ui-listview-item-active" );

Expand Down

0 comments on commit e4bb2c5

Please sign in to comment.