mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR More robust path concat in HtmlEditorField.js (means it doesn't break with translatable module enabled)
This commit is contained in:
parent
5010d95cfa
commit
f01ca808db
@ -730,14 +730,14 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
return this.find('.ss-htmleditorfield-file[data-id=' + idOrUrl + ']');
|
||||
},
|
||||
showFileView: function(idOrUrl, successCallback) {
|
||||
var self = this, params = (Number(idOrUrl) == idOrUrl) ? '?ID=' + idOrUrl : '?FileURL=' + idOrUrl,
|
||||
var self = this, params = (Number(idOrUrl) == idOrUrl) ? {ID: idOrUrl} : {FileURL: idOrUrl},
|
||||
item = $('<div class="ss-htmleditorfield-file" />');
|
||||
|
||||
item.addClass('loading');
|
||||
this.find('.content-edit').append(item);
|
||||
$.ajax({
|
||||
// url: this.data('urlViewfile') + '?ID=' + id,
|
||||
url: this.attr('action').replace(/MediaForm/, 'viewfile') + params,
|
||||
url: $.path.addSearchParams(this.attr('action').replace(/MediaForm/, 'viewfile'), params),
|
||||
success: function(html, status, xhr) {
|
||||
var newItem = $(html);
|
||||
item.replaceWith(newItem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user