Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Bootstrap automatic carets

Home Forums Older releases 1.0.x + Bootstrap addon Bootstrap automatic carets

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2575
    bluemondaydesign
    Participant

    Is it possible to build the automatic carets back in?

    I ask because my navs are completely dynamic (pulling from SQL) and I’ll have to reconfigure them with more code logic to determine if a caret is needed, then the extra div code for that caret. The previous way was just so much easier and less coding and logic.

    Maybe an extra js “addon” per se to add that back for those that want it.

    Thanks!

    #2577
    admin
    Keymaster

    Hmm, I may think of some easy tweak in the future (like a new data-* attribute to control this easily) but for now you would need to edit “jquery.smartmenus.bootstrap.js” – you need to replace the following code:

    			$this.addClass('sm').smartmenus({
    
    					// these are some good default options that should work for all
    					// you can, of course, tweak these as you like
    					subMenusSubOffsetX: 2,
    					subMenusSubOffsetY: -6,
    					subIndicators: false,
    					collapsibleShowFunction: null,
    					collapsibleHideFunction: null,
    					rightToLeftSubMenus: $this.hasClass('navbar-right'),
    					bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
    				})

    with the following:

    			$this.addClass('sm').smartmenus({
    
    					// these are some good default options that should work for all
    					// you can, of course, tweak these as you like
    					subMenusSubOffsetX: 2,
    					subMenusSubOffsetY: -6,
    					subIndicators: true,
    					subIndicatorsPos: 'append',
    					subIndicatorsText: '',
    					collapsibleShowFunction: null,
    					collapsibleHideFunction: null,
    					rightToLeftSubMenus: $this.hasClass('navbar-right'),
    					bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
    				})
    				.find('span.sub-arrow').addClass('caret').end()
    #2580
    bluemondaydesign
    Participant

    Easy enough of an edit! Now I can update to v1. 😀

    A future data attribute would be perfect. Thanks so much for considering it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘1.0.x + Bootstrap addon’ is closed to new topics and replies.