Changeset 6692
- Timestamp:
- Jan 21, 2015, 3:42:04 PM (8 years ago)
- Location:
- trunk/www/common/annotations
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/common/annotations/inherit.js
r6684 r6692 26 26 { 27 27 var inherit = {}; 28 var joustTree; 28 29 29 30 inherit.initPage = function() … … 32 33 Buttons.addClickHandler('close', App.closeWindow); 33 34 Buttons.addClickHandler('btnSave', inherit.save); 35 36 Events.addEventHandler('quickFilter', 'keyup', inherit.quickFilter); 34 37 35 38 IconStore.addDefaultIcons(); … … 41 44 Events.addEventHandler('joust', 'joust-select', inherit.onSelect); 42 45 Joust2.draw('joust'); 46 joustTree = Data.json('joust', 'joust-tree'); 43 47 } 44 48 … … 155 159 } 156 160 161 inherit.quickFilter = function() 162 { 163 var frm = document.forms['annotations']; 164 var filter = frm.quickFilter.value.toLowerCase(); 165 var totalVisible = 0; 166 for (var itemNo = 0; itemNo < joustTree.length; itemNo++) 167 { 168 var menuItem = joustTree[itemNo]; 169 var childrenVisible = 0; 170 for (var childNo = 0; childNo < menuItem.children.length; childNo++) 171 { 172 var childItem = menuItem.children[childNo]; 173 var visible = !filter || childItem.annotationType.toLowerCase().indexOf(filter)>=0; 174 Doc.showHide(childItem.id, visible); 175 if (visible) childrenVisible++; 176 } 177 totalVisible += childrenVisible; 178 Doc.showHide(menuItem.id, childrenVisible > 0); 179 } 180 181 Doc.showHide('noMatchingFilter', totalVisible == 0); 182 } 157 183 158 184 -
trunk/www/common/annotations/inherit.jsp
r6607 r6692 299 299 <div class="absolutefull bg-filled-100 rightborder" style="width: 28em;"> 300 300 301 <div class="absolutefull parameterlist" style="bottom: 3em;"> 301 <div class="absolutefull bottomborder" style="height: 2em;"> 302 <% 303 if (parentAnnotations.size() > 0) 304 { 305 %> 306 <table style="width: 100%;"> 307 <tr> 308 <td style="padding-left: 4px; padding-right: 4px;"><base:icon image="filter.png"/></td> 309 <td style="width: 100%; padding-top: 1px;"> 310 <input type="text" name="quickFilter" id="quickFilter" 311 class="auto-init" data-auto-init="focus" 312 style="width: calc(100% - 10px);" 313 title="Type to filter annotation types"> 314 </td> 315 </table> 316 <% 317 } 318 %> 319 </div> 320 <div class="absolutefull parameterlist" style="top: 2em; bottom: 3em;"> 302 321 <div id="joust" class="joust absolutefull" 303 322 data-joust-tree="<%=HTML.encodeTags(json.toJSONString()) %>" … … 307 326 { 308 327 %> 309 <div class="messagecontainer error" >There are no parent items with annotations.</div>328 <div class="messagecontainer error" style="margin: 2em;">There are no parent items with annotations.</div> 310 329 <% 311 330 } 312 331 %> 332 <div id="noMatchingFilter" class="messagecontainer error" style="margin: 2em; display: none;">No annotations matches the filter.</div> 313 333 </div> 314 334 </div>
Note: See TracChangeset
for help on using the changeset viewer.