Finish mobilification of org view
This commit is contained in:
parent
531ddadb8a
commit
f1ea20315a
10 changed files with 153 additions and 112 deletions
|
@ -745,10 +745,15 @@ angular.module("core-ui", [])
|
|||
return clone;
|
||||
};
|
||||
|
||||
var appendRepeater = function(div, tr, headers) {
|
||||
var appendRepeater = function(div, tr, headers, includeRepeat) {
|
||||
// Find all the tds directly under the tr and convert into a header + value span.
|
||||
tr.children('td').each(function(idx, td) {
|
||||
var displayer = cloneWithAttr(tr, 'div');
|
||||
|
||||
if (!includeRepeat) {
|
||||
displayer.removeAttr('ng-repeat');
|
||||
}
|
||||
|
||||
displayer.append(headers[idx].clone(true).addClass('mobile-col-header'));
|
||||
displayer.append(cloneWithAttr(td, 'div', true).addClass('mobile-col-value'));
|
||||
div.append(displayer);
|
||||
|
@ -771,10 +776,10 @@ angular.module("core-ui", [])
|
|||
// itself should be a tr.
|
||||
if (repeater.nodeName.toLowerCase() == 'tbody') {
|
||||
$(repeater).children().each(function(idx, tr) {
|
||||
appendRepeater(divRepeater, $(tr), headers);
|
||||
appendRepeater(divRepeater, $(tr), headers, true);
|
||||
});
|
||||
} else {
|
||||
appendRepeater(divRepeater, $(repeater), headers);
|
||||
appendRepeater(divRepeater, $(repeater), headers, false);
|
||||
}
|
||||
|
||||
var repeaterBody = $(document.createElement('tbody'));
|
||||
|
|
Reference in a new issue