Merge remote-tracking branch 'andreas-trad/gridster.js.git/patch-1'

* andreas-trad/gridster.js.git/patch-1:
  Prevent multi <style> generation
This commit is contained in:
David Morse
2015-04-08 08:13:58 -06:00
5 changed files with 23 additions and 14 deletions
+7 -4
View File
@@ -4160,19 +4160,22 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_style_tag = function(css) {
var d = document;
var d = document;
if(!document.getElementById('gridster-stylesheet')){
var tag = d.createElement('style');
tag.id = 'gridster-stylesheet';
d.getElementsByTagName('head')[0].appendChild(tag);
tag.setAttribute('type', 'text/css');
if (tag.styleSheet) {
tag.styleSheet.cssText = css;
} else {
tag.appendChild(document.createTextNode(css));
tag.styleSheet.cssText = css;
}else{
tag.appendChild(document.createTextNode(css));
}
this.$style_tags = this.$style_tags.add(tag);
}
return this;
};
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -4160,19 +4160,22 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_style_tag = function(css) {
var d = document;
var d = document;
if(!document.getElementById('gridster-stylesheet')){
var tag = d.createElement('style');
tag.id = 'gridster-stylesheet';
d.getElementsByTagName('head')[0].appendChild(tag);
tag.setAttribute('type', 'text/css');
if (tag.styleSheet) {
tag.styleSheet.cssText = css;
} else {
tag.appendChild(document.createTextNode(css));
tag.styleSheet.cssText = css;
}else{
tag.appendChild(document.createTextNode(css));
}
this.$style_tags = this.$style_tags.add(tag);
}
return this;
};
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -3283,19 +3283,22 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_style_tag = function(css) {
var d = document;
var d = document;
if(!document.getElementById('gridster-stylesheet')){
var tag = d.createElement('style');
tag.id = 'gridster-stylesheet';
d.getElementsByTagName('head')[0].appendChild(tag);
tag.setAttribute('type', 'text/css');
if (tag.styleSheet) {
tag.styleSheet.cssText = css;
} else {
tag.appendChild(document.createTextNode(css));
tag.styleSheet.cssText = css;
}else{
tag.appendChild(document.createTextNode(css));
}
this.$style_tags = this.$style_tags.add(tag);
}
return this;
};