Skip to content

Commit

Permalink
Merge pull request Tencent#6 from Maizify/dev
Browse files Browse the repository at this point in the history
replace 'self' with 'that'
  • Loading branch information
Maizify committed Apr 29, 2016
2 parents 9091cb0 + 0f5198d commit a22bf58
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/vconsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function vConsole() {
this.isReady = false;
this.readyCallback = [];

var self = this;
var that = this;
bind(window, 'load', function() {
self._render();
self._bindEvent();
self._mokeConsole();
self._autoRun();
that._render();
that._bindEvent();
that._mokeConsole();
that._autoRun();
});
}

Expand All @@ -47,38 +47,38 @@ vConsole.prototype._render = function() {
* @private
*/
vConsole.prototype._bindEvent = function() {
var self = this;
var that = this;

// show console panel
bind($('.vc-show'), 'click', function() {
self.show();
that.show();
})

// hide console panel
bind($('.vc-hide'), 'click', function() {
self.hide();
that.hide();
});

// hide console panel when tap background mask
bind($('.vc-mask'), 'click', function(e) {
if (e.target != $('.vc-mask')) {
return false;
}
self.hide();
that.hide();
});

// clear a log box
bind($('.vc-clear'), 'click', function() {
self.clearLog(self.activedTab);
that.clearLog(that.activedTab);
});

// show a log box
bind($$('.vc-tab'), 'click', function(e) {
var tabName = e.target.dataset.tab;
if (tabName == self.activedTab) {
if (tabName == that.activedTab) {
return;
}
self.showTab(tabName);
that.showTab(tabName);
});
};

Expand All @@ -90,17 +90,17 @@ vConsole.prototype._mokeConsole = function() {
if (!window.console) {
return;
}
var self = this;
var that = this;
this.console.log = window.console.log;
this.console.info = window.console.info;
this.console.warn = window.console.warn;
this.console.debug = window.console.debug;
this.console.error = window.console.error;
window.console.log = function() { self._printLog('default', 'log', arguments); };
window.console.info = function() { self._printLog('default', 'info', arguments); };
window.console.warn = function() { self._printLog('default', 'warn', arguments); };
window.console.debug = function() { self._printLog('default', 'debug', arguments); };
window.console.error = function() { self._printLog('default', 'error', arguments); };
window.console.log = function() { that._printLog('default', 'log', arguments); };
window.console.info = function() { that._printLog('default', 'info', arguments); };
window.console.warn = function() { that._printLog('default', 'warn', arguments); };
window.console.debug = function() { that._printLog('default', 'debug', arguments); };
window.console.error = function() { that._printLog('default', 'error', arguments); };
};

/**
Expand Down

0 comments on commit a22bf58

Please sign in to comment.