nanoislands
Advanced tools
Comparing version 1.0.2-alfa to 1.0.3-alfa
@@ -26,3 +26,3 @@ nb.define('button', { | ||
if (this.$node && this.$node.data('uiButton')) { | ||
this.$node.find('._nb-button-content').html(text); | ||
this.$node.find('._nb-button-text').html(text); | ||
this.trigger('nb-text-set', this); | ||
@@ -45,3 +45,3 @@ } | ||
getContent: function() { | ||
return this.$node.find('._nb-button-content').html(); | ||
return this.$node.find('._nb-button-text').html(); | ||
}, | ||
@@ -48,0 +48,0 @@ |
@@ -280,16 +280,27 @@ /** | ||
var content = this.$node.find('._nb-button-content'); | ||
if (params.text || params.icon) { | ||
// use .text() to prevent XSS | ||
content.text(params.text); | ||
if (params.icon) { | ||
this.$node.addClass('_nb-with-icon'); | ||
if (!params.text) { | ||
this.$node.addClass('_nb-with-only-button'); | ||
} | ||
content.prepend('<img class="nb-icon nb-s-' + params.icon + '-icon" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">'); | ||
var text = content.find('._nb-button-text'); | ||
var before = content.find('._nb-button-before'); | ||
before.remove(); | ||
if (params.icon) { | ||
this.$node.addClass('_nb-with-icon'); | ||
if (!params.text) { | ||
this.$node.addClass('_nb-with-only-icon'); | ||
} else { | ||
this.$node.removeClass('_nb-with-only-icon'); | ||
} | ||
content.prepend('<span class="_nb-button-before"><img class="nb-icon nb-s-' + params.icon + '-icon" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"></span>'); | ||
} else { | ||
// - to prevent button from collapse if no text on <option/> | ||
this.$node.find('._nb-button-content').html(' '); | ||
this.$node.removeClass('_nb-with-icon'); | ||
} | ||
if (params.text) { | ||
if (!text) { | ||
content.append('<span class="_nb-button-text"></span>'); | ||
text = content.find('._nb-button-text'); | ||
} | ||
// use .text() to prevent XSS | ||
text.text(params.text); | ||
} else { | ||
text.remove(); | ||
} | ||
@@ -296,0 +307,0 @@ }, |
@@ -9,3 +9,3 @@ { | ||
"description": "Yate/Stylus/jQuery-UI library for Yandex corporate style", | ||
"version": "1.0.2-alfa", | ||
"version": "1.0.3-alfa", | ||
"licence": "MIT", | ||
@@ -20,4 +20,4 @@ "homepage": "http://yandex-ui.github.io/nanoislands/", | ||
"es5-shim": "4.0.5", | ||
"stylobate": "1.0.0-alpha.14", | ||
"stylobate-islands": "1.0.0-alpha.19" | ||
"stylobate": "1.0.0-alpha.17", | ||
"stylobate-islands": "1.0.0-alpha.22" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
49193
2292822
+ Addedstylobate@1.0.0-alpha.17(transitive)
+ Addedstylobate-islands@1.0.0-alpha.22(transitive)
- Removedstylobate@1.0.0-alpha.14(transitive)
- Removedstylobate-islands@1.0.0-alpha.19(transitive)
Updatedstylobate@1.0.0-alpha.17