MINOR More robust path concat in HtmlEditorField.js (means it doesn't break with translatable module enabled)

This commit is contained in:
Ingo Schommer 2012-05-16 00:10:00 +02:00
parent 5010d95cfa
commit f01ca808db

View File

@ -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);