| New file |
| | |
| | | /** |
| | | * 纠错按钮 |
| | | * |
| | | * @author haoml |
| | | */ |
| | | define([ "dojo", "dojo/_base/declare", "base/AppEvent","dojo/_base/lang", |
| | | "controls/toolbar/tools/BaseTool", "dojo/dom-style", "base/ConfigData" ], function(dojo, |
| | | declare, AppEvent, lang, BaseTool, domStyle, ConfigData) { |
| | | var RL = declare([ BaseTool ], |
| | | { |
| | | constructor : function(args) { |
| | | this._normalIconClass = "tool-errcorrect-normal"; |
| | | this._overIconClass = "tool-errcorrect-over"; |
| | | this._selectedIconClass = "tool-errcorrect-select"; |
| | | this._disableClass = ""; |
| | | this.tooltip = "地图纠错"; |
| | | |
| | | AppEvent.addAppEventListener(AppEvent.ERRCORRECT_RUN, lang.hitch(this,function(data){ |
| | | this.activate(); |
| | | })); |
| | | AppEvent.addAppEventListener(AppEvent.ERRCORRECT_CLOSE,lang.hitch(this,function(){ |
| | | this.deactivate(); |
| | | })); |
| | | }, |
| | | deactivate : function(args) { |
| | | this.inherited(arguments); |
| | | AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET, |
| | | "IndexWidget"); |
| | | }, |
| | | activate : function(args) { |
| | | if(typeof(ConfigData["userInfo"]) == "undefined" || ConfigData["userInfo"] == ""){ |
| | | alert("请先登录"); |
| | | return; |
| | | } |
| | | |
| | | this.inherited(arguments); |
| | | AppEvent.dispatchAppEvent(AppEvent.RUN_WIDGET,"ErrCorrectWidget"); |
| | | } |
| | | }); |
| | | return RL; |
| | | }); |