diff --git a/kdm.py b/kdm.py index 5a599a1..ef5f328 100644 --- a/kdm.py +++ b/kdm.py @@ -1,9 +1,7 @@ from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, Response # Config -DEBUG = True - - +DEBUG = False app = Flask(__name__) app.config.from_object(__name__) diff --git a/static/javascript/kdm.js b/static/javascript/kdm.js index f24b7c0..6503f7b 100644 --- a/static/javascript/kdm.js +++ b/static/javascript/kdm.js @@ -71,9 +71,15 @@ $(function() { $('.dropdown-submenu').click( - function() { - $('.dropdown-submenu > .dropdown-menu').css('display','block'); - return false; + function(event) { + // stop bootstrap.js to hide the parents + event.stopPropagation(); + // hide the open children + $( this ).find(".dropdown-submenu").removeClass('open'); + // add 'open' class to all parents with class 'dropdown-submenu' + $( this ).parents(".dropdown-submenu").addClass('open'); + // this is also open (or was) + $( this ).toggleClass('open'); }); $("#load-dialog").dialog({