Dynamics Crm Connector  v1.0
 All Data Structures Namespaces Files Functions Variables Pages
Functions
dynsections.js File Reference

Go to the source code of this file.

Functions

function toggleVisibility (linkObj)
 
function updateStripes ()
 
function toggleLevel (level)
 
function toggleFolder (id)
 
function toggleInherit (id)
 

Function Documentation

function toggleFolder (   id)

Definition at line 49 of file dynsections.js.

References updateStripes().

50 {
51  // the clicked row
52  var currentRow = $('#row_'+id);
53 
54  // all rows after the clicked row
55  var rows = currentRow.nextAll("tr");
56 
57  var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
58 
59  // only match elements AFTER this one (can't hide elements before)
60  var childRows = rows.filter(function() { return this.id.match(re); });
61 
62  // first row is visible we are HIDING
63  if (childRows.filter(':first').is(':visible')===true) {
64  // replace down arrow by right arrow for current row
65  var currentRowSpans = currentRow.find("span");
66  currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
67  currentRowSpans.filter(".arrow").html('►');
68  rows.filter("[id^=row_"+id+"]").hide(); // hide all children
69  } else { // we are SHOWING
70  // replace right arrow by down arrow for current row
71  var currentRowSpans = currentRow.find("span");
72  currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
73  currentRowSpans.filter(".arrow").html('▼');
74  // replace down arrows by right arrows for child rows
75  var childRowsSpans = childRows.find("span");
76  childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
77  childRowsSpans.filter(".arrow").html('►');
78  childRows.show(); //show all children
79  }
80  updateStripes();
81 }
function updateStripes()
Definition: dynsections.js:22
function toggleInherit (   id)

Definition at line 84 of file dynsections.js.

85 {
86  var rows = $('tr.inherit.'+id);
87  var img = $('tr.inherit_header.'+id+' img');
88  var src = $(img).attr('src');
89  if (rows.filter(':first').is(':visible')===true) {
90  rows.css('display','none');
91  $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
92  } else {
93  rows.css('display','table-row'); // using show() causes jump in firefox
94  $(img).attr('src',src.substring(0,src.length-10)+'open.png');
95  }
96 }
function toggleLevel (   level)

Definition at line 28 of file dynsections.js.

References a, each(), and updateStripes().

29 {
30  $('table.directory tr').each(function() {
31  var l = this.id.split('_').length-1;
32  var i = $('#img'+this.id.substring(3));
33  var a = $('#arr'+this.id.substring(3));
34  if (l<level+1) {
35  i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
36  a.html('&#9660;');
37  $(this).show();
38  } else if (l==level+1) {
39  i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
40  a.html('&#9658;');
41  $(this).show();
42  } else {
43  $(this).hide();
44  }
45  });
46  updateStripes();
47 }
function a
Definition: jquery.js:39
function updateStripes()
Definition: dynsections.js:22
b each(["height","width"], function(bv, e){b.cssHooks[e]={get:function(by, bx, bw){var bz;if(bx){if(by.offsetWidth!==0){return p(by, e, bw)}else{b.swap(by, a7, function(){bz=p(by, e, bw)})}return bz}}, set:function(bw, bx){if(bc.test(bx)){bx=parseFloat(bx);if(bx >=0){return bx+"px"}}else{return bx}}}})
function toggleVisibility (   linkObj)

Definition at line 1 of file dynsections.js.

2 {
3  var base = $(linkObj).attr('id');
4  var summary = $('#'+base+'-summary');
5  var content = $('#'+base+'-content');
6  var trigger = $('#'+base+'-trigger');
7  var src=$(trigger).attr('src');
8  if (content.is(':visible')===true) {
9  content.hide();
10  summary.show();
11  $(linkObj).addClass('closed').removeClass('opened');
12  $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
13  } else {
14  content.show();
15  summary.hide();
16  $(linkObj).removeClass('closed').addClass('opened');
17  $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
18  }
19  return false;
20 }
function updateStripes ( )

Definition at line 22 of file dynsections.js.

Referenced by toggleFolder(), and toggleLevel().

23 {
24  $('table.directory tr').
25  removeClass('even').filter(':visible:even').addClass('even');
26 }