Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Navbar Initializer Not Callable from Javascript #491

Closed
ebollens opened this issue Nov 12, 2013 · 2 comments
Closed

Navbar Initializer Not Callable from Javascript #491

ebollens opened this issue Nov 12, 2013 · 2 comments
Assignees
Milestone

Comments

@ebollens
Copy link
Contributor

Right now, if you want to define a nav.bar, you must do it within the DOM before onLoad. It should be possible to add later and apply the effects then.

@ghost ghost assigned ebollens Nov 12, 2013
@ebollens
Copy link
Contributor Author

I propose we put this under the WebBlocks namespace of jQuery per #486

@ebollens
Copy link
Contributor Author

Oh this is beautifully easy now:

$('#content nav.bar').blocks().navbar('init');

Similarly, if suppose we have a custom event that fires when we resize some special container via Javascript:

$('#my-container').trigger('myCustomEvent');

We can attach a handler to determine if the navbar will be overflowed or not in that context:

$('#my-container').on('myCustomEvent', function(){
    $(this).find('nav.bar').blocks().navbar('reflow');
});

ebollens pushed a commit that referenced this issue Nov 19, 2013
Fix #486 Fix #491 - Add $.fn.blocks() and $.fn.blocks().navbar(cmd) with 'init' and 'reflow'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant