Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions dashboardv2/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,34 @@ require(['App',
'select2'
], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList, VRelationshipSearchList, Enums, Utils) {
var that = this;
var sanitizeBootstrapButtonLoadingText = function() {
if (!window.jQuery || !$.fn || !$.fn.button ||
!$.fn.button.Constructor) {
return
}

var Button = $.fn.button.Constructor
if (Button.prototype._safeSetState) {
return
}

var originalSetState = Button.prototype.setState
if (!originalSetState) {
return
}

Button.prototype.setState = function(state) {
var data = this.$element ? this.$element.data() : null
var key = state + 'Text'
if (data && data[key]) {
data[key] = $('<div/>').text(data[key]).text()
}
return originalSetState.call(this, state)
}
Button.prototype._safeSetState = true
}

sanitizeBootstrapButtonLoadingText()
this.asyncFetchCounter = 5 + (Enums.addOnEntities.length + 1);
// entity
this.entityDefCollection = new VEntityList();
Expand Down
28 changes: 28 additions & 0 deletions dashboardv2/public/js/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,34 @@ require([
'bootstrap'
], function(Marionette, Helper) {
var that = this;
var sanitizeBootstrapButtonLoadingText = function() {
if (!window.jQuery || !$.fn || !$.fn.button ||
!$.fn.button.Constructor) {
return
}

var Button = $.fn.button.Constructor
if (Button.prototype._safeSetState) {
return
}

var originalSetState = Button.prototype.setState
if (!originalSetState) {
return
}

Button.prototype.setState = function(state) {
var data = this.$element ? this.$element.data() : null
var key = state + 'Text'
if (data && data[key]) {
data[key] = $('<div/>').text(data[key]).text()
}
return originalSetState.call(this, state)
}
Button.prototype._safeSetState = true
}

sanitizeBootstrapButtonLoadingText()
var App = new Marionette.Application();

App.addRegions({
Expand Down
28 changes: 28 additions & 0 deletions dashboardv3/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,34 @@ require(['App',
'select2'
], function(App, Router, Helper, CommonViewFunction, Globals, UrlLinks, VEntityList, VTagList, VRelationshipSearchList, Enums, Utils) {
var that = this;
var sanitizeBootstrapButtonLoadingText = function() {
if (!window.jQuery || !$.fn || !$.fn.button ||
!$.fn.button.Constructor) {
return
}

var Button = $.fn.button.Constructor
if (Button.prototype._safeSetState) {
return
}

var originalSetState = Button.prototype.setState
if (!originalSetState) {
return
}

Button.prototype.setState = function(state) {
var data = this.$element ? this.$element.data() : null
var key = state + 'Text'
if (data && data[key]) {
data[key] = $('<div/>').text(data[key]).text()
}
return originalSetState.call(this, state)
}
Button.prototype._safeSetState = true
}

sanitizeBootstrapButtonLoadingText()
this.asyncFetchCounter = 5 + (Enums.addOnEntities.length + 1);
// entity
this.entityDefCollection = new VEntityList();
Expand Down
28 changes: 28 additions & 0 deletions dashboardv3/public/js/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,34 @@ require([
'select2'
], function(Marionette, Helper) {
var that = this;
var sanitizeBootstrapButtonLoadingText = function() {
if (!window.jQuery || !$.fn || !$.fn.button ||
!$.fn.button.Constructor) {
return
}

var Button = $.fn.button.Constructor
if (Button.prototype._safeSetState) {
return
}

var originalSetState = Button.prototype.setState
if (!originalSetState) {
return
}

Button.prototype.setState = function(state) {
var data = this.$element ? this.$element.data() : null
var key = state + 'Text'
if (data && data[key]) {
data[key] = $('<div/>').text(data[key]).text()
}
return originalSetState.call(this, state)
}
Button.prototype._safeSetState = true
}

sanitizeBootstrapButtonLoadingText()
var App = new Marionette.Application();

App.addRegions({
Expand Down