Skip to content

Commit

Permalink
Merge pull request #4 from unicef-polymer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
adi130987 authored Nov 7, 2016
2 parents cede948 + e732a30 commit 1a5157c
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions etools-repeatable-field-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,10 @@
<paper-icon-button on-click="_toggle" icon$="[[_getExpandBtnIcon(open)]]"></paper-icon-button>
<div class="title">[[title]] <span hidden$="{{showCounter}}">([[model.length]])</span></div>

<paper-fab hidden$="{{hidePlus}}"
icon="add"
on-tap="_addElement"
hidden$="{{!open}}"
title="Add"></paper-fab>
<paper-fab hidden$="{{hideFab}}"
icon="add"
on-tap="_addElement"
title="Add"></paper-fab>
</paper-toolbar>

<iron-collapse id="collapse" opened>
Expand All @@ -181,18 +180,18 @@

<div class="layout vertical center-justified wrap actions" hidden$="[[hidePlus]]">
<paper-icon-button class="action delete"
on-tap="_openDeleteConfirmation"
data-args$="[[index]]"
icon="cancel"></paper-icon-button>
on-tap="_openDeleteConfirmation"
data-args$="[[index]]"
icon="cancel"></paper-icon-button>
<paper-icon-button class="action copy"
hidden$="[[!allowCopy]]"
on-tap="_copyElement"
data-args$="[[index]]"
icon="content-copy"></paper-icon-button>
hidden$="[[!allowCopy]]"
on-tap="_copyElement"
data-args$="[[index]]"
icon="content-copy"></paper-icon-button>
</div>

<div class="vertical-bar" hidden$="[[hideVerticalDivider]]"
data-count-val$="[[_displayIndex(index, showCounter)]]"></div>
data-count-val$="[[_displayIndex(index, showCounter)]]"></div>

</div>
<div class="item-content layout horizontal flex" id="item-[[index]]"></div>
Expand All @@ -219,6 +218,10 @@
type: Boolean,
value: false
},
hideFab: {
type: Boolean,
computed: '_computeHideFab(hidePlus, open)'
},
model: {
type: Array,
notify: true,
Expand Down Expand Up @@ -266,6 +269,9 @@
value: -1
}
},
_computeHideFab: function(hidePlus, open) {
return hidePlus && open;
},
_getHasCounterClass: function(showCounter) {
if (showCounter) {
return 'has-counter';
Expand Down Expand Up @@ -360,10 +366,12 @@
this._itemCounter = this._isCopy;
this._isCopy = -1;
}
children.forEach(function(child) {
children.forEach(function(child) {
self.async(function() {
self.$$('#item-' + self._itemCounter).appendChild(child);
self._itemCounter += 1;
});
})
});
},
ready: function() {
if (!this.hidePlus) {
Expand Down

0 comments on commit 1a5157c

Please sign in to comment.