Merge pull request #372 from okriuchykhin/ok_SCI_816

Fix flash message display in samples table [SCI-816]
This commit is contained in:
okriuchykhin 2016-12-30 15:30:14 +01:00 committed by GitHub
commit 73478d7b5e
2 changed files with 11 additions and 7 deletions

View file

@ -193,9 +193,11 @@ function notificationAlertClose(){
.removeClass("alert-shown");
});
}
(function(){
var HelperModule = (function(){
function tree_link_truncation() {
var helpers = {};
helpers.treeLinkTruncation = function() {
$('.tree-link a').each( function(){
truncateLongString( $(this), <%= Constants::NAME_TRUNCATION_LENGTH %>);
});
@ -204,21 +206,22 @@ function notificationAlertClose(){
});
}
function hide_flash_msg() {
helpers.hideFlashMsg = function() {
var flash = $('.alert');
if (flash.length > 0) {
window.setTimeout(function () {
flash.fadeTo(500, 0).slideUp(500, function () {
$(this).remove();
$('#content-wrapper')
.css('marginTop', '50px');
$('#content-wrapper').removeClass('alert-shown');
});
}, 5000);
}
}
$( document ).ready(function() {
tree_link_truncation();
hide_flash_msg();
helpers.treeLinkTruncation();
helpers.hideFlashMsg();
});
return helpers;
})();

View file

@ -500,6 +500,7 @@ function onClickSave() {
data: data,
success: function (data) {
sampleAlertMsg(data.flash, "success");
HelperModule.hideFlashMsg();
onClickCancel();
},
error: function (e, eData, status, xhr) {