Kaynağa Gözat

fix linter errors

Adam Shaw 10 yıl önce
ebeveyn
işleme
b4af6b8045
3 değiştirilmiş dosya ile 10 ekleme ve 6 silme
  1. 2 2
      src/Header.js
  2. 2 2
      src/common/Emitter.js
  3. 6 2
      src/util.js

+ 2 - 2
src/Header.js

@@ -72,7 +72,7 @@ function Header(calendar, options) {
 						isOnlyButtons = false;
 					}
 					else {
-						if (customButtonProps = (calendar.options.customButtons || {})[buttonName]) {
+						if ((customButtonProps = (calendar.options.customButtons || {})[buttonName])) {
 							buttonClick = function(ev) {
 								if (customButtonProps.click) {
 									customButtonProps.click.call(button[0], ev);
@@ -81,7 +81,7 @@ function Header(calendar, options) {
 							overrideText = ''; // icons will override text
 							defaultText = customButtonProps.text;
 						}
-						else if (viewSpec = calendar.getViewSpec(buttonName)) {
+						else if ((viewSpec = calendar.getViewSpec(buttonName))) {
 							buttonClick = function() {
 								calendar.changeView(buttonName);
 							};

+ 2 - 2
src/common/Emitter.js

@@ -10,13 +10,13 @@ var Emitter = fc.Emitter = Class.extend({
 	},
 
 
-	off: function (name, callback) {
+	off: function(name, callback) {
 		this.getCallbacks(name).remove(callback);
 		return this; // for chaining
 	},
 
 
-	trigger: function (name) { // args...
+	trigger: function(name) { // args...
 		var args = Array.prototype.slice.call(arguments, 1);
 
 		this.triggerWith(name, this, args);

+ 6 - 2
src/util.js

@@ -620,13 +620,17 @@ function isTimeString(str) {
 ----------------------------------------------------------------------------------------------------------------------*/
 
 fc.log = function() {
-	if (window.console && window.console.log) {
+	var console = window.console;
+
+	if (console && console.log) {
 		return console.log.apply(console, arguments);
 	}
 };
 
 fc.warn = function() {
-	if (window.console && window.console.warn) {
+	var console = window.console;
+
+	if (console && console.warn) {
 		return console.warn.apply(console, arguments);
 	}
 	else {