[FileUpload] Make upload button selector configurable

This commit is contained in:
Matthew Bargar 2016-04-27 18:51:19 -04:00
parent 9e4f4099f8
commit 6fce94e110
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@
<div class="header">
<h2 class="title">Edit Saved Objects</h2>
<button class="btn btn-default controls" ng-click="exportAll()"><i aria-hidden="true" class="fa fa-download"></i> Export Everything</button>
<file-upload on-read="importAll(fileContents)">
<file-upload on-read="importAll(fileContents)" upload-selector="button.upload">
<button class="btn btn-default controls upload" ng-click>
<i aria-hidden="true" class="fa fa-upload"></i> Import
</button>

View file

@ -12,11 +12,11 @@ module.directive('fileUpload', function () {
scope: {
onRead: '&',
onLocate: '&',
label: '='
uploadSelector: '@'
},
template: html,
link: function ($scope, $elem, attrs) {
let $button = $elem.find('.upload');
let $button = $elem.find($scope.uploadSelector);
let $dropzone = $elem.find('.dropzone');
const handleFile = (file) => {