Skip to content

Commit 1791b83

Browse files
committed
Better coding style
1 parent 319f1bd commit 1791b83

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

component.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

intro.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
function _goToStep(step) {
113113
//because steps starts with zero
114114
this._currentStep = step - 2;
115-
if(typeof(this._introItems) !== 'undefined') {
115+
if(typeof (this._introItems) !== 'undefined') {
116116
_nextStep.call(this);
117117
}
118118
}
@@ -124,7 +124,7 @@
124124
* @method _nextStep
125125
*/
126126
function _nextStep() {
127-
if (typeof(this._currentStep) === 'undefined') {
127+
if (typeof (this._currentStep) === 'undefined') {
128128
this._currentStep = 0;
129129
} else {
130130
++this._currentStep;
@@ -133,7 +133,7 @@
133133
if((this._introItems.length) <= this._currentStep) {
134134
//end of the intro
135135
//check if any callback is defined
136-
if (typeof this._introCompleteCallback === 'function') {
136+
if (typeof (this._introCompleteCallback) === 'function') {
137137
this._introCompleteCallback.call(this);
138138
}
139139
_exitIntro.call(this, this._targetElement);
@@ -248,7 +248,7 @@
248248
*/
249249
function _showElement(targetElement) {
250250

251-
if (typeof this._introChangeCallback !== 'undefined') {
251+
if (typeof (this._introChangeCallback) !== 'undefined') {
252252
this._introChangeCallback.call(this, targetElement);
253253
}
254254

@@ -362,7 +362,7 @@
362362
//Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml
363363
var currentElementPosition = '';
364364
if (targetElement.currentStyle) { //IE
365-
currentElementPosition = targetElement.currentStyle.position;
365+
currentElementPosition = targetElement.currentStyle['position'];
366366
} else if (document.defaultView && document.defaultView.getComputedStyle) { //Firefox
367367
currentElementPosition = document.defaultView.getComputedStyle(targetElement, null).getPropertyValue('position');
368368
}
@@ -450,9 +450,7 @@
450450
//set overlay layer position
451451
var elementPosition = _getOffset(targetElm);
452452
if(elementPosition) {
453-
styleText += 'width: ' + elementPosition.width + 'px; height:' +
454-
elementPosition.height + 'px; top:' + elementPosition.top +
455-
'px;left: ' + elementPosition.left + 'px;';
453+
styleText += 'width: ' + elementPosition.width + 'px; height:' + elementPosition.height + 'px; top:' + elementPosition.top + 'px;left: ' + elementPosition.left + 'px;';
456454
overlayLayer.setAttribute('style', styleText);
457455
}
458456
}
@@ -513,10 +511,9 @@
513511
* @returns obj3 a new object based on obj1 and obj2
514512
*/
515513
function _mergeOptions(obj1,obj2) {
516-
var obj3 = {},
517-
attrname;
518-
for (attrname in obj1) { obj3[attrname] = obj1[attrname]; }
519-
for (attrname in obj2) { obj3[attrname] = obj2[attrname]; }
514+
var obj3 = {};
515+
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
516+
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
520517
return obj3;
521518
}
522519

0 commit comments

Comments
 (0)