Skip to content

Instantly share code, notes, and snippets.

@mteichtahl
Created February 6, 2014 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mteichtahl/8841043 to your computer and use it in GitHub Desktop.
Save mteichtahl/8841043 to your computer and use it in GitHub Desktop.
this.$palettes.on('hidden.bs.collapse', function (e) {
var $this = $(this),
$target = $(e.target);
var $span = $("span[itemprop=expandCollapseIcons]");
var $i = $("span[itemprop=expandCollapseIcons] i");
// It's the $i who has class "icon-chevron-down" so
if ($i.hasClass('icon-chevron-down')) {
$i.removeClass('icon-chevron-down').addClass('icon-chevron-up');
} else {
$i.removeClass('icon-chevron-up').addClass('icon-chevron-down');
}
});
this.$palettes.on('show.bs.collapse', function (e) {
var iframe = self.iframe(),
$iframe = $(iframe.document),
$this = $(this),
$target = $(e.target),
targetPage = $target.attr('id').slice(0, -6),
$expandCollapseIcons = find('.accordion-toggle span[itemprop="expandCollapseIcons"] i');
var $span = $("span[itemprop=expandCollapseIcons]");
var $i = $("span[itemprop=expandCollapseIcons] i");
// It's the $i who has class "icon-chevron-down" so
if ($i.hasClass('icon-chevron-up')) {
$i.removeClass('icon-chevron-up').addClass('icon-chevron-down');
} else {
$i.removeClass('icon-chevron-down').addClass('icon-chevron-up');
}
if (targetPage === 'styles')
return;
if (iframe.jQuery)
iframe.jQuery.mobile.changePage('#' + targetPage);
self.$pageMarker.val(targetPage);
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment