LT-275: Making common animation labels act as normal labels when clicked

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:25:09 +01:00
1 parent 5a9379e6c3
commit cc8f486204
6 files changed
+40 -19

No files matched your search

@@ -9,6 +9,9 @@ Template.selectTreeCommon.events({
// Get the clicked label
const $target = $(event.currentTarget);
// Store the offset position for further use
$target.data('offset', $target.offset());
// Build the input selector based on the label target
const inputSelector = '#' + $target.attr('for');
@@ -23,6 +26,9 @@ Template.selectTreeCommon.events({
// Wait for options rerendering
Tracker.afterFlush(() => {
const $treeRoot = treeInstance.$('.select-tree-root:first').first();
$treeRoot.addClass('common-clicked');
// Wait for components initialization
Meteor.defer(() => $(inputSelector).click());
});