Skip to content

Commit

Permalink
Correction to TinyMCE Inputfield that interfered with selection of im…
Browse files Browse the repository at this point in the history
…ages from other pages.
  • Loading branch information
ryancramerdesign committed Jun 9, 2011
1 parent a09b327 commit 03b6039
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -101,15 +101,16 @@ var $iframe;

"Insert This Image": function() {

function insertImage(url) {
function insertImage() {
var $i = $iframe.contents();
var $img = $("#selected_image", $i);
var width = $img.attr('width');
var height = $img.attr('height');
var alt = $("#selected_image_description", $i).val();
var cls = $img.removeClass('ui-resizable').attr('class');
var link = $("#selected_image_link:checked", $i).val();
var html = '<img class="' + cls + '" src="' + url + '" mce_src="' + url + '" ';
var src = $img.attr('src');
var html = '<img class="' + cls + '" src="' + src + '" mce_src="' + src + '" ';

if(alt && alt.length > 0) alt = $("<div />").text(alt).html().replace(/"/g, '&quot;');

Expand Down Expand Up @@ -137,9 +138,8 @@ var $iframe;

$.get(modalUri + 'resize?id=' + page_id + '&file=' + file + '&width=' + width + '&height=' + height, function(data) {
var $div = $("<div></div>").html(data);
var $img = $div.find("#selected_image");
var url = $img.attr('src');
insertImage(url);
// var $img = $div.find("#selected_image");
insertImage();
});

},
Expand Down

0 comments on commit 03b6039

Please sign in to comment.