mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
removed initialize anti pattern from constructor in favor of doing initialization in constructor in navcontrol.js
This commit is contained in:
parent
114a26b1a9
commit
b061a4d830
@ -1221,7 +1221,7 @@ $.Utils = new $.Utils();
|
||||
|
||||
(function( $ ){
|
||||
|
||||
$.NavControl = function(viewer) {
|
||||
$.NavControl = function( viewer ) {
|
||||
this._group = null;
|
||||
this._zooming = false; // whether we should be continuously zooming
|
||||
this._zoomFactor = null; // how much we should be continuously zooming by
|
||||
@ -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);
|
||||
@ -1295,9 +1291,12 @@ $.NavControl.prototype = {
|
||||
});
|
||||
|
||||
this.elmt = this._group.element;
|
||||
this.elmt[$.SIGNAL] = true; // hack to get our controls to fade
|
||||
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;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
(function( $ ){
|
||||
|
||||
$.NavControl = function(viewer) {
|
||||
$.NavControl = function( viewer ) {
|
||||
this._group = null;
|
||||
this._zooming = false; // whether we should be continuously zooming
|
||||
this._zoomFactor = null; // how much we should be continuously zooming by
|
||||
@ -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);
|
||||
@ -75,9 +71,12 @@ $.NavControl.prototype = {
|
||||
});
|
||||
|
||||
this.elmt = this._group.element;
|
||||
this.elmt[$.SIGNAL] = true; // hack to get our controls to fade
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user