Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 82c7570

Browse files
committed
diff check for re-init
1 parent cb2a437 commit 82c7570

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

dist/xrayhtml.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! X-rayHTML - v1.0.3 - 2015-09-08
1+
/*! X-rayHTML - v2.0.0 - 2015-09-15
22
* https://github.com/filamentgroup/x-rayhtml
33
* Copyright (c) 2015 ; Licensed MIT */
44

@@ -123,4 +123,3 @@
123123
-webkit-transform: rotateY(0deg);
124124
-moz-transform: rotateY(0deg);
125125
}
126-

dist/xrayhtml.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
2-
/*
3-
* View Source
4-
* Generates copy/pastable markup from actual rendered markup.
5-
*
6-
* Copyright (c) 2012 Filament Group, Inc.
7-
* Licensed under the MIT, GPL licenses.
8-
*/
1+
/*! X-rayHTML - v2.0.0 - 2015-09-15
2+
* https://github.com/filamentgroup/x-rayhtml
3+
* Copyright (c) 2015 ; Licensed MIT */
94

105
window.jQuery = window.jQuery || window.shoestring;
116

@@ -116,9 +111,12 @@ window.jQuery = window.jQuery || window.shoestring;
116111
$.extend( $.fn[ pluginName ].prototype, methods );
117112

118113
// auto-init
114+
var initted;
119115
function init(){
120-
$( o.initSelector )[ pluginName ]();
121-
init = function(){};
116+
if( !initted ){
117+
$( o.initSelector )[ pluginName ]();
118+
initted = true;
119+
}
122120
}
123121
// init either on beforeenhance event or domready, whichever comes first.
124122
$( document ).bind("beforeenhance", init );

src/X-rayHTML.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ window.jQuery = window.jQuery || window.shoestring;
116116
$.extend( $.fn[ pluginName ].prototype, methods );
117117

118118
// auto-init
119+
var initted;
119120
function init(){
120-
$( o.initSelector )[ pluginName ]();
121-
init = function(){};
121+
if( !initted ){
122+
$( o.initSelector )[ pluginName ]();
123+
initted = true;
124+
}
122125
}
123126
// init either on beforeenhance event or domready, whichever comes first.
124127
$( document ).bind("beforeenhance", init );

0 commit comments

Comments
 (0)