mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Merge pull request #1203 from mlorb/ml-sci-2479
Fix truncation bug [SCI-2479]
This commit is contained in:
commit
8e90efa94b
2 changed files with 2 additions and 14 deletions
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue