Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Conversation

@manishbisht
Copy link
Contributor

@manishbisht manishbisht commented Oct 19, 2016

Fixes: #160

Licence: MIT or AGPL

Description

Hide icon-loading-dark after loading the image and displaying it back when the image is loading.

Tested on

  • Ubuntu 14.04/Chrome

Reviewers

@oparoz

@jancborchardt
Copy link
Member

@jaller94 @oparoz can you review this please?

@jaller94
Copy link

For me this only works when viewing the image for the first time.

  1. Click on a small image to view it in the gallery. (loading-icon will disappear).
  2. Press left or right to switch to another image.
  3. Switch back to your small image. This time the loading-icon won't disappear.

Can you reproduce this behaviour?

  • Ubuntu 16.10/Chrome 54
  • Ubuntu 16.10/Firefox 49

@codecov-io
Copy link

Current coverage is 99.75% (diff: 100%)

Merging #165 into master will not change coverage

@@             master       #165   diff @@
==========================================
  Files            39         39          
  Lines          1201       1201          
  Methods         170        170          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1198       1198          
  Misses            3          3          
  Partials          0          0          

Powered by Codecov. Last update ec0d5a0...95373a6

@manishbisht manishbisht force-pushed the hide-icon-loading-dark branch 4 times, most recently from e01e4fd to b0efcfa Compare February 17, 2017 14:53
@manishbisht
Copy link
Contributor Author

I have updated the PR can you review it again @jaller94 @oparoz

@jaller94
Copy link

It took me a long time to understand why you placed the two commands at those positions.
A line like // Removes loading icon if loading the image has finished and the user didn't aborted the process would be helpful. Is the function next is called on every picture (also the first picture and if you go to a previous image)? That name confused me.

@manishbisht
Copy link
Contributor Author

@jaller94 For the first command what it does is it simply hides the loading icon after successfully loading the image. and the second command show the icon back if the image is still loading and then it is again hidden after loading the image using first command.

@jaller94
Copy link

jaller94 commented Feb 17, 2017

I reviewed it and tested it on my personal Nextcloud instance. I approve of your Pull Request.

@manishbisht Hope you can convince the auto checks and someone in the project.

Copy link

@jaller94 jaller94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two additions in the code are perfectly suitable to fix the referenced issue.

js/slideshow.js Outdated
* @param {Object} next
*/
next: function (current, next) {
this.container.find('.icon-loading-dark').show();
Copy link

@oliverpool oliverpool Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could move this before line 99.

I think it then looks more natural to call show() and then call hide() on resolution of the promise a couple of lines "later".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, show spinner, hide image, load image, hide spinner.

@oparoz oparoz added this to the Nextcloud 12.0 milestone Mar 4, 2017
@manishbisht manishbisht force-pushed the hide-icon-loading-dark branch 2 times, most recently from 357162e to 17ed0e2 Compare March 4, 2017 15:46
@manishbisht
Copy link
Contributor Author

I have moved the code after the mentioned line @oparoz @oliverpool

@oliverpool
Copy link

@manishbisht it appears that you need to sign off your commit

@manishbisht
Copy link
Contributor Author

Earlier this was not required. Good to see this feature here !!
It seems like I have to make the signoff commit using command git commit --signoff ?

@oliverpool
Copy link

oliverpool commented Mar 4, 2017

It seems like I have to make the signoff commit using command git commit --signoff ?

From what I understand, you need to amend your commit with the git commit --signoff --amend command, for your commit to be signed.

Signed-off-by: Manish Bisht <manish.bisht490@gmail.com>
@manishbisht manishbisht force-pushed the hide-icon-loading-dark branch from 17ed0e2 to 45fa4b0 Compare March 5, 2017 11:12
@manishbisht
Copy link
Contributor Author

@oliverpool I have signoff my commit

@oparoz oparoz merged commit 9023884 into nextcloud:master Mar 5, 2017
@manishbisht manishbisht deleted the hide-icon-loading-dark branch March 5, 2017 11:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants