From 32a345d0c3c79f0d6425b71313d50f2b17a0edcd Mon Sep 17 00:00:00 2001 From: Paulina Date: Thu, 25 Feb 2016 16:42:12 +0100 Subject: [PATCH] Remove unnecessary semicolons, add minified file --- dist/cytoscape-actionbar.js | 6 +++++- dist/cytoscape-actionbar.min.js | 2 +- src/CytoscapeActionbar.coffee | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/cytoscape-actionbar.js b/dist/cytoscape-actionbar.js index 2d401d3..dcf9047 100644 --- a/dist/cytoscape-actionbar.js +++ b/dist/cytoscape-actionbar.js @@ -15,9 +15,13 @@ $actionbar = $("
"); $actionbar.appendTo($(cy.container())); $.each(options.items, function(itemIndex, element) { - var $element, clazz; + var $condition, $element, clazz; clazz = options.actionItemClass + ' icon ' + element.icon; $element = $(""); + if (element.condition) { + $condition = $(element.condition); + $element = $condition.append($element); + } $actionbar.append($element); return $element.on('click', function() { return element.action(cy, element); diff --git a/dist/cytoscape-actionbar.min.js b/dist/cytoscape-actionbar.min.js index 5b05458..3617925 100644 --- a/dist/cytoscape-actionbar.min.js +++ b/dist/cytoscape-actionbar.min.js @@ -1 +1 @@ -!function(t){var n;return n=function(){function n(n,a){var o;a=t.extend(!0,{},this.defaults,a),o=t("
"),o.appendTo(t(n.container())),t.each(a.items,function(i,c){var e,s;return s=a.actionItemClass+" icon "+c.icon,e=t(""),o.append(e),e.on("click",function(){return c.action(n,c)}).hover(function(n){return t(n.target).css("color","#000")},function(n){return t(n.target).css("color","#aaa")})})}return n.prototype.defaults={items:[],appendTools:!1,actionbarClass:"ui-cytoscape-actionbar",multipleToolsClass:"action-item-list",actionItemClass:"action-item"},n}(),cytoscape("core","actionbar",function(t){return new n(this,t),this})}(jQuery); \ No newline at end of file +!function(t){var n;return n=function(){function n(n,o){var a;o=t.extend(!0,{},this.defaults,o),a=t("
"),a.appendTo(t(n.container())),t.each(o.items,function(i,c){var e,s,r;return r=o.actionItemClass+" icon "+c.icon,s=t(""),c.condition&&(e=t(c.condition),s=e.append(s)),a.append(s),s.on("click",function(){return c.action(n,c)}).hover(function(n){return t(n.target).css("color","#000")},function(n){return t(n.target).css("color","#aaa")})})}return n.prototype.defaults={items:[],appendTools:!1,actionbarClass:"ui-cytoscape-actionbar",multipleToolsClass:"action-item-list",actionItemClass:"action-item"},n}(),cytoscape("core","actionbar",function(t){return new n(this,t),this})}(jQuery); \ No newline at end of file diff --git a/src/CytoscapeActionbar.coffee b/src/CytoscapeActionbar.coffee index 789d87c..be17c2f 100644 --- a/src/CytoscapeActionbar.coffee +++ b/src/CytoscapeActionbar.coffee @@ -18,8 +18,8 @@ $element = $("") if element.condition - $condition = $(element.condition); - $element = $condition.append($element); + $condition = $(element.condition) + $element = $condition.append($element) $actionbar.append($element)