ember-cli-photoswipe icon indicating copy to clipboard operation
ember-cli-photoswipe copied to clipboard

How to configure Ui

Open picklefarmer opened this issue 9 years ago • 1 comments

Default UI Options

Options for PhotoSwipeUI_Default (dist/ui/photoswipe-ui-default.js) are added the same way and to the same object as core options.

-Source

Specifically, I am interested in these

shareButtons: [ {id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'}, {id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'}, {id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}'}, {id:'download', label:'Download image', url:'{{raw_image_url}}', download:true} ],

Edit

It looks like there was already some work towards this already? #10

picklefarmer avatar Feb 17 '16 00:02 picklefarmer

@picklefarmer Maybe I'm doing it wrong or I misunderstand the question, but I've solved a similar configuration issue by overriding _buildOptions in the PhotoSwipe component.

@components/photo-swipe.js

import Ember from 'ember';
import PhotoSwipe from 'ember-cli-photoswipe/components/photo-swipe';

export default PhotoSwipe.extend({

  _buildOptions: function(getThumbBoundsFn) {
    this._super(getThumbBoundsFn);

    const options = {
      shareButtons: [ < your share buttons here > ]
    };
    this.set('options', Ember.merge(options, this.get('options')));
  }
});

rhengeveld avatar Apr 26 '16 15:04 rhengeveld