Skip to content

Commit 735193c

Browse files
committed
switch to independent options objects
1 parent 7f4dd8e commit 735193c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

addon/mixins/ember-filepicker.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,25 @@ export default Ember.Mixin.create({
2424
onSelection: null,
2525
onError: null,
2626
onClose: null,
27-
options : {},
27+
pickerOptions : {},
28+
storeOptions : {},
2829
filepicker: Ember.inject ? Ember.inject.service() : null,
2930
openFilepicker: function() {
3031
Ember.run.scheduleOnce('afterRender', this, function(){
3132
this.get('filepicker.promise').then(Ember.run.bind(this, function(filepicker) {
32-
var options = this.get('options');
33-
if (options && options.useStore) {
33+
var pickerOptions = this.get('pickerOptions');
34+
var storeOptions = this.get('storeOptions');
35+
if (pickerOptions && storeOptions) {
3436
filepicker.pickAndStore(
35-
options.picker,
36-
options.store,
37+
pickerOptions,
38+
storeOptions,
3739
Ember.run.bind(this, this.handleSelection),
3840
Ember.run.bind(this, this.handleError)
3941
);
4042
}
4143
else {
4244
filepicker.pick(
43-
options,
45+
pickerOptions,
4446
Ember.run.bind(this, this.handleSelection),
4547
Ember.run.bind(this, this.handleError)
4648
);

0 commit comments

Comments
 (0)