Skip to content

Commit

Permalink
MINOR More robust path concat in HtmlEditorField.js (means it doesn't…
Browse files Browse the repository at this point in the history
… break with translatable module enabled)
  • Loading branch information
chillu committed May 15, 2012
1 parent 5010d95 commit f01ca80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions javascript/HtmlEditorField.js
Expand Up @@ -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);
Expand Down

0 comments on commit f01ca80

Please sign in to comment.