Merge pull request #1203 from mlorb/ml-sci-2479

Fix truncation bug [SCI-2479]
This commit is contained in:
mlorb 2018-06-11 15:53:43 +02:00 committed by GitHub
commit 8e90efa94b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

View file

@ -32,10 +32,6 @@ var ignoreUnsavedWorkAlert;
initializeAddContentsModal();
initializeUnsavedWorkDialog();
$('.report-nav-link').each(function() {
truncateLongString($(this), <%= Constants::NAME_TRUNCATION_LENGTH %>);
});
// Automatically display the "Add content" modal
$('.new-element.initial').click();
}
@ -955,11 +951,3 @@ $(document).ready(function() {
init();
}
})
$(document).change(function(){
setTimeout(function(){
$(".report-nav-link").each( function(){
truncateLongString( $(this), <%= Constants::NAME_TRUNCATION_LENGTH %>);
});
}, 1000);
});

View file

@ -28,12 +28,12 @@ function truncateLongString( el, chars ) {
}
if ( html ) {
el.html(html.outerHTML + newText + '...' );
el.text(html.outerHTML + newText + '...' );
} else {
if($.type(el) === 'string'){
return newText + '...';
} else {
el.html(newText + '...' );
el.text(newText + '...' );
}
}
} else {