]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 560003: Hide the "Add Bug URLs" box behind an (add) link.
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 20 Jul 2010 21:26:15 +0000 (14:26 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 20 Jul 2010 21:26:15 +0000 (14:26 -0700)
r=timello, a=mkanat

js/field.js
template/en/default/bug/field.html.tmpl

index 2fff5931dff9cf3d8688873c220f3ea72e71dfae..d2e800b908f9f6c1db6b700c4fbd9273ea35f1f1 100644 (file)
@@ -203,6 +203,12 @@ function updateCalendarFromField(date_field) {
     }
 }
 
+function setupEditLink(id) {
+    var link_container = 'container_showhide_' + id;
+    var input_container = 'container_' + id;
+    var link = 'showhide_' + id;
+    hideEditableField(link_container, input_container, link);
+}
 
 /* Hide input fields and show the text with (edit) next to it */  
 function hideEditableField( container, input, action, field_id, original_value ) {
index 2417ce39b25e4d57d42c71b8e9a61ab4127af9c6..49cf718cc5190a08f74d6b6ab8550fc27d1632d7 100644 (file)
        [% '</ul>' IF value.size %]
 
        [% IF Param('use_see_also') %]
-         <label for="[% field.name FILTER html %]">
-           <strong>Add [% terms.Bug %] URLs:</strong>
-         </label><br>
-         <input type="text" id="[% field.name FILTER html %]" size="40"
-                class="text_input" name="[% field.name FILTER html %]">
+         <span id="container_showhide_[% field.name FILTER html %]"
+               class="bz_default_hidden">
+           <a href="#" id="showhide_[% field.name FILTER html %]">(add)</a>
+         </span>
+         <div id="container_[% field.name FILTER html %]">
+           <label for="[% field.name FILTER html %]">
+             <strong>Add [% terms.Bug %] URLs:</strong>
+           </label><br>
+           <input type="text" id="[% field.name FILTER html %]" size="40"
+                  class="text_input" name="[% field.name FILTER html %]">
+         </div>
+         <script type="text/javascript">
+             setupEditLink('[% field.name FILTER js %]');
+         </script>
        [% END %]
      [% CASE constants.FIELD_TYPE_KEYWORDS %]
        <div id="keyword_container">