Skip to content

Commit

Permalink
Merge pull request #6 from unicef-polymer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
adi130987 authored Mar 8, 2017
2 parents 50e369d + 40ccb12 commit 127c658
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body>
<div class="vertical-section-container centered">
<h3>etools-file demo</h3>
<!--

<demo-snippet>
<template is="dom-bind">
<demo-helper multiple-files="{{multipleFiles}}" single-file="{{singleFile}}" files="{{files}}" file-data="{{fileData}}"></demo-helper>
Expand Down Expand Up @@ -90,7 +90,6 @@ <h3>etools-file demo</h3>

</template>
</demo-snippet>
-->

<h3>Custom file array, with ids and other data, all not used properties will remain unchanged</h3>

Expand Down
14 changes: 7 additions & 7 deletions etools-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
<span class="file-name" title="[[file.file_name]]">[[file.file_name]]</span>
</div>

<template is="dom-if" if="[[_showReadonlyType(file.type)]]">
<template is="dom-if" if="[[_showReadonlyType(file.type, readonly)]]">
<div class="file-type-input-wrapper">
<paper-input class="file-type-input" label="[[fileTypesLabel]]"
value="[[_getFileTypeStr(file.type)]]"
placeholder="&#8212;" readonly></paper-input>
</div>
</template>
<template is="dom-if" if="[[_showFileType(fileTypes.length)]]">
<template is="dom-if" if="[[_showFileType(fileTypes.length, readonly)]]">
<!-- types dropdown -->
<paper-dropdown-menu class="type-dropdown" label="[[fileTypesLabel]]" placeholder="&#8212;" noink>
<paper-menu id$="typeDropdown_[[index]]" class="dropdown-content"
Expand Down Expand Up @@ -252,12 +252,12 @@
}
},

_showFileType: function(fileTypesLength) {
return this.activateFileTypes && fileTypesLength > 0 && this.readonly === false;
_showFileType: function(fileTypesLength, readonly) {
return this.activateFileTypes && fileTypesLength > 0 && readonly === false;
},

_showReadonlyType(fileType) {
return this.readonly && this.activateFileTypes;
_showReadonlyType: function(fileType, readonly) {
return readonly && this.activateFileTypes;
},

_getFileTypeStr: function(fileType) {
Expand Down Expand Up @@ -382,7 +382,7 @@
return fileAlreadySelected;
},

_displayAlreadySelectedWarning(filesAlreadySelected) {
_displayAlreadySelectedWarning: function(filesAlreadySelected) {
// show a warning with the already selected files
var toastWarningMessage = '<p><strong>The following file are already selected:</strong><p>';
filesAlreadySelected.forEach(function(alreadySelectedFile) {
Expand Down
7 changes: 0 additions & 7 deletions style/etools-file-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,10 @@
color: var(--etools-file-delete-btn-color, #f1572a);
}

.files-container.multiple .files-wrapper {
@apply(--layout-flex);
}

.files-container.multiple .upload-button-wrapper {
@apply(--layout-vertical);
@apply(--layout-end-justified);
}
.files-container .upload-button-wrapper > span {
@apply(--layout);
}

.files-container.multiple {
@apply(--layout-vertical);
Expand Down

0 comments on commit 127c658

Please sign in to comment.