Aralot (aralot) wrote in changelog,
Aralot
aralot
changelog

[ljcom] r10122: LJINT-365: close button, expander, logou...

Committer: szhirkov
LJINT-365: close button, expander, logout block, etc.
U   trunk/htdocs/js/partners/placeholder.js
U   trunk/htdocs/js/partners/xdreceiver.js
Modified: trunk/htdocs/js/partners/placeholder.js
===================================================================
--- trunk/htdocs/js/partners/placeholder.js	2011-02-24 11:45:56 UTC (rev 10121)
+++ trunk/htdocs/js/partners/placeholder.js	2011-02-24 12:00:22 UTC (rev 10122)
@@ -12,19 +12,31 @@
 			e.preventDefault();
 			$(this).closest('.b-auth-error').fadeOut('fast');
 		});
+		
 		$('form').bind('submit', function () {
 			if (this.target != "ljidentityauth") {
 				submitButtons.attr('disabled', 'disabled');
 			}
 		});
 
-		//disable submit controls if comment is empty
+		// disable submit controls if comment is empty
 		var commentText = $('#commenttext');
-		if(commentText.length > 0) {
-			commentText.input(function() {
+		if (commentText.length > 0) {
+			commentText.input(function () {
 				submitButtons.attr('disabled', this.value.length === 0 );
-			}).trigger("input");
+			}).trigger('input');
 		}
+		
+		// close frame crossdomain event
+		var closeButton = $('#close-button'),
+			crossDomainIframe = $('iframe.iframe-crossdomain');
+			
+		closeButton.bind('click', function (e) {
+			var iframeSrc;
+			e.preventDefault();
+			iframeSrc = crossDomainIframe.attr('src') + '&mode=close_frame';
+			crossDomainIframe.attr('src', iframeSrc);
+		});
 	});
 	
 	$.fn.placeholder = function () {

Modified: trunk/htdocs/js/partners/xdreceiver.js
===================================================================
--- trunk/htdocs/js/partners/xdreceiver.js	2011-02-24 11:45:56 UTC (rev 10121)
+++ trunk/htdocs/js/partners/xdreceiver.js	2011-02-24 12:00:22 UTC (rev 10122)
@@ -14,6 +14,8 @@
 	} catch (e) {
 		window.location.href = 'about:blank';
 	}
+} else if (vars.mode == 'close_frame') {
+	window.top.LJCloseFrame( );
 } else {
 	window.top.LJAddComment( vars );
 }
\ No newline at end of file

Tags: aralot, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments