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 { Template } from 'meteor/templating';
|
||||||
import { Blaze } from 'meteor/blaze';
|
import { Blaze } from 'meteor/blaze';
|
||||||
|
import { $ } from 'meteor/jquery';
|
||||||
import { _ } from 'meteor/underscore';
|
import { _ } from 'meteor/underscore';
|
||||||
|
|
||||||
Template.dropdownForm.onRendered(() => {
|
Template.dropdownForm.onRendered(() => {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
|
const dropdown = instance.$('.dropdown');
|
||||||
|
|
||||||
// Show the 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)
|
// Destroy the Blaze created view (either created with template calls or with renderWithData)
|
||||||
instance.destroyView = () => {
|
instance.destroyView = () => {
|
||||||
@ -20,6 +23,12 @@ Template.dropdownForm.onRendered(() => {
|
|||||||
|
|
||||||
Template.dropdownForm.events({
|
Template.dropdownForm.events({
|
||||||
'click .dropdown'(event, instance) {
|
'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
|
// UI Styles
|
||||||
api.addFiles([
|
api.addFiles([
|
||||||
'client/ui/resizable/resizable.styl'
|
'client/ui/resizable/resizable.styl',
|
||||||
|
'client/components/bootstrap/dropdown/dropdown.styl'
|
||||||
], 'client');
|
], 'client');
|
||||||
|
|
||||||
api.mainModule('main.js', ['client', 'server']);
|
api.mainModule('main.js', ['client', 'server']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user