Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r20580: LJSUP-10298: Need to hide flag "don't pr...

Committer: vkurkin
LJSUP-10298: Need to hide flag "don't provide to friends and in RSS" if user select community for field "Post to" or tries to post entry to community
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2011-11-21 10:06:47 UTC (rev 20579)
+++ trunk/htdocs/js/entry.js	2011-11-21 11:35:35 UTC (rev 20580)
@@ -28,10 +28,13 @@
 
 	var modifyDate = jQuery('#modifydate'),
 		stickyCheckbox = jQuery('#sticky_type'),
+		doNotAddType = jQuery('#entryform-do_not_add-wrapper'),
 		stickyLabel = jQuery('#sticky_type_label'),
 		stickyWrapper = jQuery('#entryform-sticky-wrapper'),
 		currentDateEdit = jQuery('#currentdate-edit');
 
+	doNotAddType[Site.currentJournal == journal ? 'show' : 'hide']();
+
 		journal = Site.remote_permissions[journal];
 
 	if (!journal.can_post_delayed) {
@@ -64,26 +67,26 @@
 }
 
 function changeSubmit(prefix, defaultjournal, defPrefix){
-	if(document.getElementById){
-		var usejournal = document.getElementById('usejournal');
-		var formsubmit = document.getElementById('formsubmit');
-		var newvalue, commname;
-		if(!defaultjournal){
-			newvalue = prefix;
-		} else if(!usejournal || usejournal.value == ''){
-			newvalue = prefix + ' ' + defaultjournal;
-			commname = defaultjournal;
+	var usejournal = document.getElementById('usejournal'),
+		formsubmit = document.getElementById('formsubmit'),
+		newvalue,
+		commname;
+
+	if(!defaultjournal){
+		newvalue = prefix;
+	} else if(!usejournal || usejournal.value == ''){
+		newvalue = prefix + ' ' + defaultjournal;
+		commname = defaultjournal;
+	} else {
+		if(usejournal.value === '[none]'){
+			newvalue = defPrefix;
 		} else {
-			if(usejournal.value === '[none]'){
-				newvalue = defPrefix;
-			} else {
-				newvalue = prefix + ' ' + usejournal.value;
-			}
-			commname = usejournal.value;
+			newvalue = prefix + ' ' + usejournal.value;
 		}
-		formsubmit.disabled = ( /\[none\]/.test(commname) || /^ext_/.test(commname) );
-		formsubmit.value = newvalue;
+		commname = usejournal.value;
 	}
+	formsubmit.disabled = ( /\[none\]/.test(commname) || /^ext_/.test(commname) );
+	formsubmit.value = newvalue;
 }
 
 function new_post_load(dotime){

Tags: b_vladi, js, livejournal, vkurkin
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