diff options
Diffstat (limited to 'mod/embed/views/default')
| -rw-r--r-- | mod/embed/views/default/js/embed/embed.php | 25 | 
1 files changed, 10 insertions, 15 deletions
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php index 6d4e2e4ea..840d8f89c 100644 --- a/mod/embed/views/default/js/embed/embed.php +++ b/mod/embed/views/default/js/embed/embed.php @@ -14,9 +14,9 @@ elgg.embed.init = function() {  	});  	// special pagination helper for lightbox -	$('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.loadContent); +	$('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.forward); -	$('.embed-section').live('click', elgg.embed.loadContent); +	$('.embed-section').live('click', elgg.embed.forward);  	$('.embed-upload .elgg-form').live('submit', elgg.embed.submit);  } @@ -31,25 +31,20 @@ elgg.embed.init = function() {   */  elgg.embed.insert = function(event) {  	var textAreaId = elgg.embed.textAreaId; +	var textArea = $('#' + textAreaId);  	// generalize this based on a css class attached to what should be inserted  	var content = ' ' + $(this).find(".elgg-image").html() + ' '; +	textArea.val(textArea.val() + content); +	textArea.focus(); +	  <?php -// If a wysiwyg editor has been registered, it handles the insertion by -// overriding the embed/custom_insert_js view. See the TinyMCE plugin for an -// example of this. -$custom_insert_code = elgg_view('embed/custom_insert_js'); -if ($custom_insert_code) { -	echo $custom_insert_code; -} else { -?> -	$('#' + textAreaId).val($('#' + textAreaId).val() + content); -	$('#' + textAreaId).focus(); -<?php -} +// See the TinyMCE plugin for an example of this view + echo elgg_view('embed/custom_insert_js');  ?> +  	$.fancybox.close();  	event.preventDefault(); @@ -98,7 +93,7 @@ elgg.embed.submit = function(event) {   * @param {Object} event   * @return void   */ -elgg.embed.loadContent = function(event) { +elgg.embed.forward = function(event) {  	$('.embed-wrapper').parent().load($(this).attr('href'));  	event.preventDefault();  }  | 
