Commit 73bf850f by kevalbhatt

ATLAS-3711 : UI: Classification/Term modal should close after…

ATLAS-3711 : UI: Classification/Term modal should close after create/update/delete response #2 loader improvement for cancel button
parent 076d83c3
......@@ -630,8 +630,8 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
superTypes = [];
var getData = function(data, collection) {
if (data) {
superTypes = superTypes.concat(data.superTypes);
if (data.superTypes && data.superTypes.length) {
_.each(data.superTypes, function(superTypeName) {
if (collection.fullCollection) {
......@@ -639,10 +639,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} else {
var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
}
return getData(collectionData, collection);
getData(collectionData, collection);
});
}
}
}
getData(data, collection);
return _.uniq(superTypes);
}
......@@ -887,9 +888,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
$.fn.showButtonLoader = function() {
$(this).attr("disabled", "true").addClass('button-loader');
$(this).siblings("button.cancel").prop("disabled", true);
}
$.fn.hideButtonLoader = function() {
$(this).removeClass('button-loader').removeAttr("disabled");
$(this).siblings("button.cancel").prop("disabled", false);
}
return Utils;
});
\ No newline at end of file
......@@ -103,7 +103,6 @@ define(['require',
}).open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.modal.on('ok', function(e) {
that.modal.$el.find('button.cancel').attr("disabled", true);
that.modal.$el.find('button.ok').showButtonLoader();
that.okButton();
});
......@@ -788,7 +787,6 @@ define(['require',
editVisiblityOfEntitySelectionBox: true
});
that.modal.$el.find('button.ok').hideButtonLoader();
that.modal.$el.find('button.cancel').attr("disabled", false);
}
});
......
......@@ -677,8 +677,8 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
superTypes = [];
var getData = function(data, collection) {
if (data) {
superTypes = superTypes.concat(data.superTypes);
if (data.superTypes && data.superTypes.length) {
_.each(data.superTypes, function(superTypeName) {
if (collection.fullCollection) {
......@@ -686,10 +686,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} else {
var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
}
return getData(collectionData, collection);
getData(collectionData, collection);
});
}
}
}
getData(data, collection);
return _.uniq(superTypes);
}
......@@ -935,9 +936,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
$.fn.showButtonLoader = function() {
$(this).attr("disabled", "true").addClass('button-loader');
$(this).siblings("button.cancel").prop("disabled", true);
}
$.fn.hideButtonLoader = function() {
$(this).removeClass('button-loader').removeAttr("disabled");
$(this).siblings("button.cancel").prop("disabled", false);
}
return Utils;
});
\ No newline at end of file
......@@ -103,7 +103,6 @@ define(['require',
}).open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.modal.on('ok', function(e) {
that.modal.$el.find('button.cancel').attr("disabled", true);
that.modal.$el.find('button.ok').showButtonLoader();
that.okButton();
});
......@@ -794,7 +793,6 @@ define(['require',
editVisiblityOfEntitySelectionBox: true
});
that.modal.$el.find('button.ok').hideButtonLoader();
that.modal.$el.find('button.cancel').attr("disabled", false);
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment