This repository was archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Navbar: Implement Classes Option #8297
Closed
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d9c6393
navbar: factor out grid start smart stacking
cgack f46af75
navbar: add morebutton extension and new demos
cgack bc0fae8
navbar: add morebutton icon, formatting
cgack 456d16a
navbar: morebutton icon demo added
cgack f697f36
navbar: replace delegate with _on + formatting
cgack 8213082
navbar: morebuttonicon as option
cgack 05fbffd
navbar: css formatting
cgack 8f167b1
navbar: add refresh method
cgack e54e44b
navbar: add _destroy and refactoring
cgack 6a59139
navbar: remove grid tests - fix depracated ui-disabled test
cgack fc4122b
navbar: remove unused grid test
cgack 772b899
navbar: update refresh method
cgack 99efd56
navbar: add tests for maxbutton, refresh, and destroy
cgack 1dd3ca9
navbar: tests and listview dependency
cgack 0ec8ddb
Navbar: css update
cgack b29deef
Navbar: grid css cleanup and tuning
cgack 9b05c1f
navbar: demo page updates
cgack 7ee5fde
Navbar: Fix spacing on multiple rows and footers
cgack 1653dcc
Navbar: Implement Classes and Review
cgack d67668a
Navbar: Classes Option
cgack 105c938
Navbar: Classes Option
cgack 0fa56f3
Navbar: Classes Option
cgack acec5d7
Navbar: Implement Classes Option
cgack 5ffbe72
Navbar: Implement Classes Option
cgack 245f827
Navbar: Implement Classes Option
cgack c53fefc
Navbar: Implement Classes Option
cgack 33ff362
Navbar: Implement Classes Option
cgack 408fe86
Navbar: Implement Classes Option
cgack f4d2dc8
Navbar: Implement Classes Option
cgack fa686ad
Navbar: Implement Classes Option
cgack 346b5d0
Navbar: Implement Classes Option
cgack d8a71bf
Navbar: Implement Classes Option
cgack 7d3b026
Navbar: Implement Classes Option
cgack 6da2904
Navbar: Implement Classes Option
cgack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
navbar: add morebutton extension and new demos
- Loading branch information
commit f46af7502de3584bcad3cc8450a8de78b2ff31eb
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); | ||
| //>>description: navbar morebutton extension. | ||
| //>>label: NavbarMoreButton | ||
| //>>group: Widgets | ||
| //>>css.structure: ../css/structure/jquery.mobile.navbar.css | ||
| //>>css.theme: ../css/themes/default/jquery.mobile.theme.css | ||
|
|
||
| define( [ "jquery", "./navbar", "./popup" ], function( jQuery ) { | ||
| //>>excludeEnd("jqmBuildExclude"); | ||
| (function( $, undefined ) { | ||
|
|
||
| $.widget( "mobile.navbar", $.mobile.navbar, { | ||
|
|
||
| options: { | ||
| morebutton: false, | ||
| morebuttontext: "..." | ||
| }, | ||
|
|
||
| _create: function() { | ||
| if (this.options.morebutton) { | ||
| $.extend(this, { | ||
| _createNavRows: function() {} | ||
| }); | ||
| this._createNavPopup(); | ||
| } | ||
| this._super(); | ||
| }, | ||
|
|
||
| _id: function() { | ||
| return ( this.element.attr( "id" ) || ( this.widgetName + this.uuid ) ); | ||
| }, | ||
|
|
||
| _createNavPopup: function(){ | ||
| var $navbar = this.element, | ||
| $navbtns = $navbar.find( "a" ), | ||
| $navitems = $navbar.find( "li" ), | ||
| numbuttons = $navbtns.length, | ||
| maxbutton = this.options.maxbutton, | ||
| iconpos = this.option.iconpos, | ||
| $popupDiv, | ||
| $popupNav, | ||
| morebtn, | ||
| pos, | ||
| btn, | ||
| id; | ||
|
|
||
| id = this._id() + "-popup"; | ||
| $popupDiv = $( "<div class='ui-navbar-popup' id='" + id + "'></div>" ); | ||
| $popupNav = $( "<ul class='ui-navbar-popupnav'>" ) | ||
| .appendTo( $popupDiv ); | ||
|
|
||
| // enhance buttons and move to new rows | ||
| for( pos = 0; pos < numbuttons; pos++ ) { | ||
| btn = $navitems.eq(pos); | ||
| this._makeNavButton(btn.find("a"), iconpos); | ||
| if (pos + 1 === maxbutton) { | ||
| morebtn = $( "<li></li>" ).append( | ||
| $( "<a></a>" ) | ||
| .attr( "href", "#" + id) | ||
| .attr( "data-rel", "popup" ) | ||
| .addClass( "ui-btn" ) | ||
| .html( this.options.morebuttontext )); | ||
| $navbar.find( "ul" ).first().append( morebtn ); | ||
|
|
||
| } | ||
| if ( pos + 1 >= maxbutton ) { | ||
| btn.detach(); | ||
| $popupNav.append( btn ); | ||
| } | ||
| $popupNav.listview(); | ||
|
|
||
| } | ||
| $popupDiv.appendTo( $navbar ); | ||
| $popupDiv.popup(); | ||
| } | ||
| }); | ||
|
|
||
| })( jQuery ); | ||
| //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); | ||
| }); | ||
| //>>excludeEnd("jqmBuildExclude"); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unneeded parens