]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Resize editlink textarea while editing an existing shaare
authorArthurHoaro <arthur@hoa.ro>
Fri, 4 Nov 2016 12:48:33 +0000 (13:48 +0100)
committerArthurHoaro <arthur@hoa.ro>
Sat, 5 Nov 2016 13:29:56 +0000 (14:29 +0100)
tpl/default/editlink.html

index 369b0a1d218162649bede36ff644d1ca377b3b0b..3c9b5cda7cdceeb7e6ce5e977508d4b4b1b12037 100644 (file)
   {/if}
 <script>
   awesompleteUniqueTag('#lf_tags');
-  if (!'{$link.title}') {
+  if (!document.linkform.lf_title.value) {
     document.linkform.lf_title.focus();
-  } else if (!'{$link.description}') {
+  } else if (!document.linkform.lf_description.value) {
     document.linkform.lf_description.focus();
   } else {
     document.linkform.lf_tags.focus();
   }
-
   function textAreaAdjust(el) {
-      el.style.height = (el.scrollHeight > el.clientHeight) ? (el.scrollHeight)+"px" :  (el.clientHeight-18)+"px";
+    el.style.height = (el.scrollHeight > el.clientHeight) ? (el.scrollHeight) + "px" : (el.clientHeight - 18) + "px";
   }
+  (function (window, document) {
+    textAreaAdjust(document.linkform.lf_description)
+  })(this, this.document);
 </script>
 </body>
 </html>