removed initialize anti pattern from constructor in favor of doing initialization in constructor in navcontrol.js

This commit is contained in:
thatcher 2011-12-22 19:30:52 -05:00
parent 114a26b1a9
commit b061a4d830
2 changed files with 128 additions and 130 deletions

View File

@ -1230,11 +1230,7 @@ $.NavControl = function(viewer) {
this.config = this._viewer.config;
this.elmt = null;
this.initialize();
};
$.NavControl.prototype = {
initialize: function() {
var beginZoomingInHandler = $.delegate(this, this._beginZoomingIn);
var endZoomingHandler = $.delegate(this, this._endZooming);
var doSingleZoomInHandler = $.delegate(this, this._doSingleZoomIn);
@ -1297,7 +1293,10 @@ $.NavControl.prototype = {
this.elmt = this._group.element;
this.elmt[ $.SIGNAL ] = true; // hack to get our controls to fade
this._viewer.addHandler('open', $.delegate(this, this._lightUp));
},
};
$.NavControl.prototype = {
_resolveUrl: function(url) {
var prefix = this._viewer.prefixUrl;
return prefix ? prefix + url : url;

View File

@ -10,11 +10,7 @@ $.NavControl = function(viewer) {
this.config = this._viewer.config;
this.elmt = null;
this.initialize();
};
$.NavControl.prototype = {
initialize: function() {
var beginZoomingInHandler = $.delegate(this, this._beginZoomingIn);
var endZoomingHandler = $.delegate(this, this._endZooming);
var doSingleZoomInHandler = $.delegate(this, this._doSingleZoomIn);
@ -77,7 +73,10 @@ $.NavControl.prototype = {
this.elmt = this._group.element;
this.elmt[ $.SIGNAL ] = true; // hack to get our controls to fade
this._viewer.addHandler('open', $.delegate(this, this._lightUp));
},
};
$.NavControl.prototype = {
_resolveUrl: function(url) {
var prefix = this._viewer.prefixUrl;
return prefix ? prefix + url : url;