Added custom bindings files in the flask.py js list Removed inline onclick with sliderToggle and made a custom binding 'toggleContent' Add padding and line-height to intermediary heading for better readability
28 lines
926 B
JavaScript
28 lines
926 B
JavaScript
ko.bindingHandlers.toggleContent = {
|
|
init: function(element, valueAccessor) {
|
|
var $elm = $(element),
|
|
options = $.extend({
|
|
class: null,
|
|
container: null,
|
|
parent: null,
|
|
onComplete: function() {
|
|
$(document).trigger("slideCompleted");
|
|
}
|
|
}, valueAccessor());
|
|
|
|
$elm.on("click", function(e) {
|
|
e.preventDefault();
|
|
if(options.class) {
|
|
$elm.children('[class^="icon-"]').toggleClass(options.class);
|
|
}
|
|
if(options.container) {
|
|
if(options.parent) {
|
|
$elm.parents(options.parent).find(options.container).stop().slideToggle('fast', options.onComplete);
|
|
} else {
|
|
$(options.container).stop().slideToggle('fast', options.onComplete);
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
};
|