From: Mike Taylor Date: Thu, 15 May 2014 11:39:46 +0000 (+0100) Subject: The 'Switch' and 'Targets' widgets no-op if config.show_switch is false. X-Git-Tag: 1.0.0~666^2~18 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=275a65ddb6b53b56d512955c86cd5286f51554a0 The 'Switch' and 'Targets' widgets no-op if config.show_switch is false. (No point of filling the latter if it can never be displayed.) Fixes bug MKWS-186 ("make the switch widget optional in mkws_config object") --- diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index a688eac..a70e7d2 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -4,6 +4,7 @@ mkws.registerWidgetType('Targets', function() { + if (!this.config.show_switch) return; var that = this; var M = mkws.M; @@ -209,6 +210,7 @@ mkws.registerWidgetType('Done', function() { mkws.registerWidgetType('Switch', function() { + if (!this.config.show_switch) return; var tname = this.team.name(); this.jqnode.html('\ Records \