zacksmith
unread,Nov 9, 2009, 11:45:12 PM11/9/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MooEditable
Sorry, no problem. This would be in my included .js file...
~~~~~~~
MooEditable.Actions.extend({
image: {
type: 'button-overlay',
title: 'Add Image',
options: {
shortcut: 'm',
overlaySize: {x: 255, y: 235},
overlayRequest: {url: ajax_url, data: 'action=library_images'}
},
command: function(buttonOverlay, e) {
var el = e.target;
if (el.tagName.toLowerCase() != 'a') return; // a link was not
clicked
if (el.getParent().hasClass('load')) { // 'load more' link clicked
- don't close overlay; just load more images
loadMorePhotos(el);
// now if the overlay would just stay visible...
} else { // insert image html
el = $(el);
var src = el.get('rel');
var content = '<img src="'+src+'" />';
this.selection.insertContent(content);
this.focus();
}
}
}
});
~~~~~~~
Where I assumed the desired code should go is round about line 15,
where I've got the special 'loadMorePhotos' function called only when
an 'a.load' is clicked. Again, that part is working fine, except for
the fact that clicking that particular element closes the overlay,
exactly the same as happens when you click any 'a' element inside the
overlay.
Thanks again for your help!