Giter Club home page Giter Club logo

Comments (16)

oleedd avatar oleedd commented on September 26, 2024

If you have an access to "gu-mirror" cloned element which is created while moving, I can give code for scrolling.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

I don't, I'm using dragula

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

I know. But it is need to get a cloned element. As a variant just to get this element by class name.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

It is code for scrolling. You can check it just in console.

document.onmousedown = function() {
	var clone, scroll;
	document.onmouseup = function() {
		clearInterval(scroll);
		document.onmousemove = null;
	}
	document.onmousemove = function() {
		if (!clone) {
			clone = document.querySelector('.gu-mirror');
		}
		if (clone && clone.getBoundingClientRect().bottom < document.documentElement.clientHeight) {
			clearInterval(scroll);
		}
		if (clone) {
			if (clone.getBoundingClientRect().bottom > document.documentElement.clientHeight) {
				var dif = clone.getBoundingClientRect().bottom - document.documentElement.clientHeight;
				clearInterval(scroll);
				scroll = setInterval(function() {            
                	                clone.style.top = parseInt(clone.style.top) + 1;
					wrapper.scrollBy(0, 1);
				}, 250 / dif);
			}
			else if (clone.getBoundingClientRect().top < 0) {
				var dif = Math.abs(clone.getBoundingClientRect().top);
				clearInterval(scroll);
				scroll = setInterval(function() {
					clone.style.top = parseInt(clone.style.top) - 1;
					wrapper.scrollBy(0, -1);
				}, 250 / dif);
			}
		}
	}
}

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

I'll have a look later to see if I can make this work. Thanks!

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

There is no work to do from your side. There is all done and works on my side. If to paste this to the extension console then scrolling works. Just need to paste it in any place of the pop-up script after you see that it really works.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

+ there are no global variables - so no conflicts.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

Does it work for you?

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

Haven't tried it yet, sorry. Too busy with other stuff.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

Solved in v4.7.0, using https://www.npmjs.com/package/dom-autoscroller

It needed far less custom code and had some options in terms of scrolling speed, plus it animates nicely.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

I updated. But auto scrolling doesn't work. How to use it?

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

It somehow broke. I'll try and fix it later.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

image

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

Any news?

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on September 26, 2024

Fixed in #85

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on September 26, 2024

It still doesn't work in 4.8.1 and the same errors in the console. Please firstly check working of the extension before uploading to chrome web store.
The problem is not in type of function. There is an error in minifier - there is this.down in github but in the web store version there is m.down. Just change it before uploading and it will work.
Also scrolling starts to work too early. It should work when a moved bookmark touches borders. But now users can't move a bookmark to the first or the last position of view without starting scrolling. margin property better to make 0 (at least 10).

from chrome-minimal-bookmarks-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.