mardi 17 juillet 2018

Add a download icon that is only visible on hover

I need to create the download icon and it needs to visible on Mouse Hover and have to click that icon for download the corresponding items. In that I have created download icon and while clicking its downloading the file correctly. But I want to hide the download icon and it need to visible on mouse hover and click to download the items.

Here I have tried the below code:

DownloadItem: Ember.ContainerView.extend(childMOMixin, {
                classNames: ['download-icon'],
                classNameBindings: [ 'clickable' ],
                attributeBindings: [ 'style', 'src' ],
                style: function () {
                    console.log(this);
                    return 'font-size: ' + this.get('size') + 'px';
                }.property('size'),
                click: function(e) {
                var type = this.get('content.kind');
                if(type == 'Image'){
                var imgUrl = this.content.streamingUri;
                window.location = imgUrl;
                }
            childViews: [
                            'DownloadIcon',
                        ],
                        size: 20,
DownloadIcon: Core.component.DownloadIcon.extend(childMOMixin, {
              sizeBinding: 'parentView.size',
              loadStateBinding: 'parentView.loadState',
              downloadBinding: 'parentView.download'
            })

I'm using Ember 1.4.0 version. please provide me some suggestion regarding this update. Your help will be appreciate. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire