]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tpl/default/editlink.html
Resize editlink textarea while editing an existing shaare
[github/shaarli/Shaarli.git] / tpl / default / editlink.html
index 95e60cc189e56cac857a6abfd82467312c4297f3..3c9b5cda7cdceeb7e6ce5e977508d4b4b1b12037 100644 (file)
@@ -10,7 +10,7 @@
   <div id="editlinkform" class="pure-g">
     <div class="pure-u-lg-1-5 pure-u-1-8"></div>
     <form method="post" name="linkform" class="page-form pure-u-lg-3-5 pure-u-3-4 page-form page-form-light">
-      <h2>{'Shaare'|t}</h2>
+      <h2 class="window-title">{'Shaare'|t}</h2>
       <input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
       <div>
         <label for="lf_url">{'URL'|t}</label>
   {/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-8)+"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>