Do not close the menu, when clicking on the menu with checkbox.

Introduced a class 'noclose'. Then - menu-item having this class will
not propograte the events to its parent, hence - it will not be closed.

Some of the CSS applicable only to the immediate buttons only, and not
the grand-children.
This commit is contained in:
Ashesh Vashi 2016-04-25 22:06:39 +05:30
parent 26e9ceaf48
commit 9dd3aeadb5
2 changed files with 11 additions and 7 deletions

View File

@ -351,15 +351,15 @@ iframe {
border-left-style: solid
}
.pg-prop-btn-group button {
.pg-prop-btn-group > button {
margin: 2px 3px 2px 0px;
}
.pg-prop-btn-group button:first-child {
.pg-prop-btn-group > button:first-child {
margin-left: 3px;
}
.pg-prop-btn-group button:last-child {
.pg-prop-btn-group > button:last-child {
margin-right: 3px;
}

View File

@ -159,6 +159,7 @@ define(
"click #btn-auto-commit": "on_auto_commit",
"click #btn-auto-rollback": "on_auto_rollback",
"click #btn-clear-history": "on_clear_history",
"click .noclose": 'do_not_close_menu',
"change .limit": "on_limit_change"
},
@ -217,13 +218,13 @@ define(
'</button>',
'<ul class="dropdown-menu dropdown-menu">',
'<li>',
'<a id="btn-auto-commit" href="#">',
'<a id="btn-auto-commit" href="#" class="noclose">',
'<i class="auto-commit fa fa-check" aria-hidden="true"></i>',
'<span> {{ _('Auto-Commit') }} </span>',
'<span> {{ _('Auto Commit') }} </span>',
'</a>',
'<a id="btn-auto-rollback" href="#">',
'<a id="btn-auto-rollback" href="#" class="noclose">',
'<i class="auto-rollback fa fa-check visibility-hidden" aria-hidden="true"></i>',
'<span> {{ _('Auto-Rollback') }} </span>',
'<span> {{ _('Auto Rollback') }} </span>',
'</a>',
'</li>',
'</ul>',
@ -768,6 +769,9 @@ define(
self,
self.handler
);
},
do_not_close_menu: function(ev) {
ev.stopPropagation();
}
});