LT-330 Study list context menu style issues
This commit is contained in:
parent
2399b4a319
commit
c89319344a
@ -0,0 +1,3 @@
|
||||
.dropdown
|
||||
ul.dropdown-menu li
|
||||
cursor: pointer
|
||||
@ -1,12 +1,15 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Blaze } from 'meteor/blaze';
|
||||
import { $ } from 'meteor/jquery';
|
||||
import { _ } from 'meteor/underscore';
|
||||
|
||||
Template.dropdownForm.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
const dropdown = instance.$('.dropdown');
|
||||
|
||||
// Show the dropdown
|
||||
instance.$('.dropdown').addClass('open');
|
||||
dropdown.addClass('open');
|
||||
dropdown.find('ul.dropdown-menu li a').addClass('noselect');
|
||||
|
||||
// Destroy the Blaze created view (either created with template calls or with renderWithData)
|
||||
instance.destroyView = () => {
|
||||
@ -20,6 +23,12 @@ Template.dropdownForm.onRendered(() => {
|
||||
|
||||
Template.dropdownForm.events({
|
||||
'click .dropdown'(event, instance) {
|
||||
instance.destroyView();
|
||||
let target = $(event.target);
|
||||
if (target.hasClass('disabled')) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
instance.destroyView();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -24,7 +24,8 @@ Package.onUse(function(api) {
|
||||
|
||||
// UI Styles
|
||||
api.addFiles([
|
||||
'client/ui/resizable/resizable.styl'
|
||||
'client/ui/resizable/resizable.styl',
|
||||
'client/components/bootstrap/dropdown/dropdown.styl'
|
||||
], 'client');
|
||||
|
||||
api.mainModule('main.js', ['client', 'server']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user