Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smart selects w/ search bars & fixed navbars #142

Merged
merged 1 commit into from
Jul 31, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix smart selects w/ search bars & fixed navbars
When an app is using fixed navbars, smart-select pages with search-bars lack the proper nabber classification, which causes search-bar styling to be positioned incorrectly. This change passes a nabber class no matter what, ensuring the smart-select page has the proper class.
  • Loading branch information
JJJ committed Jul 30, 2014
commit 464a9d1017f97a848b8dfb38faa3e6545dccf08f
4 changes: 2 additions & 2 deletions src/js/smart-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ app.smartSelectOpen = function (smartSelect) {
var pageName = 'smart-select-' + inputName;

var noToolbar = smartSelect.parents('.page').hasClass('no-toolbar') ? 'no-toolbar' : '';
var noNavbar = smartSelect.parents('.page').hasClass('no-navbar') ? 'no-navbar' : '';
var noNavbar = smartSelect.parents('.page').hasClass('no-navbar') ? 'no-navbar' : 'navbar-' + navbarLayout;

var useSearchbar = typeof smartSelect.data('searchbar') === 'undefined' ? app.params.smartSelectSearchbar : (smartSelect.data('searchbar') === 'true' ? true : false);
var searchbarPlaceholder, searchbarCancel;
Expand All @@ -128,7 +128,7 @@ app.smartSelectOpen = function (smartSelect) {
var pageHTML =
(navbarLayout === 'through' ? navbarHTML : '') +
'<div class="pages">' +
' <div data-page="' + pageName + '" class="page smart-select-page' + noNavbar + ' ' + noToolbar + '">' +
' <div data-page="' + pageName + '" class="page smart-select-page ' + noNavbar + ' ' + noToolbar + '">' +
(navbarLayout === 'fixed' ? navbarHTML : '') +
(useSearchbar ? searchbarHTML : '') +
' <div class="page-content">' +
Expand Down