]> git.mxchange.org Git - friendica.git/commitdiff
Check for existing element in openMenu()
authorHypolite Petovan <mrpetovan@gmail.com>
Mon, 9 Jan 2017 00:34:41 +0000 (11:34 +1100)
committerHypolite Petovan <mrpetovan@gmail.com>
Mon, 9 Jan 2017 00:34:41 +0000 (11:34 +1100)
- Removed useless val() call in the various insertFormatting()
declarations

js/main.js
view/theme/duepuntozero/theme.php
view/theme/frio/js/textedit.js
view/theme/frost-mobile/js/theme.js
view/theme/frost/js/theme.js
view/theme/quattro/js/quattro.js
view/theme/smoothly/theme.php
view/theme/vier/theme.php

index b08e4515091dbfbaf897c07c382e51ecd98d4957..0b1f9227b321aa5e8f201220e6422d8577b8033b 100644 (file)
        }
 
        function openMenu(theID) {
-               document.getElementById(theID).style.display = "block"
+               var el = document.getElementById(theID)
+               if (el) {
+                       el.style.display = "block";
+               }
        }
 
        function closeMenu(theID) {
-               document.getElementById(theID).style.display = "none"
+               var el = document.getElementById(theID)
+               if (el) {
+                       el.style.display = "none";
+               }
        }
 
        function decodeHtml(html) {
index d4c11f22a28100b2e89a3ef590f601eccd732f5b..2ddfc29884348cd00183523eae43f5188a361516 100644 (file)
@@ -29,7 +29,6 @@ function insertFormatting(BBcode, id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index d3b090d537af6faa97762cb79f98f91c58bf97a1..9c5c1823d1b624c1c295e08b963b075e6d53a91c 100644 (file)
@@ -9,7 +9,6 @@ function insertFormatting(BBcode,id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index 04e391ed6ca85709186527cbbcebbc95c5880d31..477bd44c030fbd7e5988369ce152a5a0d862d21c 100644 (file)
@@ -430,7 +430,6 @@ function insertFormatting(BBcode,id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index 4f7329b1bedff6e29aa7116b24e688864a6aa47d..a4a975880333d2710b1f0bbbba09039e999f0d47 100644 (file)
@@ -794,7 +794,6 @@ function insertFormatting(BBcode, id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index c44e6d07403d5a899804f8e18309c8e770492767..9ef66e220e42b4139e5cf2cb3668f3583b94d165 100644 (file)
@@ -65,7 +65,6 @@ function insertFormatting(BBcode, id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index fcc4f99252e0767643e5ad3f1d42717ee44f3098..0dbbd47cc3eb1295a6a340d122e775ce86c90d11 100644 (file)
@@ -25,7 +25,6 @@ function insertFormatting(BBcode, id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);
index 96aae57111f4089aaf8800f6be894d7a247b3164..4e7190dbfbb72632a485a656c71d390b8e299feb 100644 (file)
@@ -42,7 +42,6 @@ function insertFormatting(BBcode, id) {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
-               $("#comment-edit-text-" + id).val(tmpStr);
        }
 
        textarea = document.getElementById("comment-edit-text-" +id);