GithubHelp home page GithubHelp logo

Comments (9)

priyajeet avatar priyajeet commented on September 16, 2024

Not sure how you create and insert the dom into view right now. But if its not done in bulk, do that instead so that there are only a few repaints.

from viewer.js.

priyajeet avatar priyajeet commented on September 16, 2024

Maybe start using the shadow dom on browsers that support it!

from viewer.js.

FredKSchott avatar FredKSchott commented on September 16, 2024

We're seeing this issue on mobile, where the entire (sometimes huge) document is loading on initialization even if they only want to see the first few pages. The resulting load is killing our users.

from viewer.js.

lakenen avatar lakenen commented on September 16, 2024

Viewer.js should never load more than ~16 pages at once unless they are somehow visible. Could be a bug, though... are you sure this is the case?

from viewer.js.

FredKSchott avatar FredKSchott commented on September 16, 2024

I'm seeing it load an entire 23-page document. I can test with a larger one later today.
On version 0.10.1, fwiw

from viewer.js.

lakenen avatar lakenen commented on September 16, 2024

Could be that the check for mobile is broken on whatever device/os you're using... What do you see when you log Crocodoc.getUtility('browser').mobile? On non-mobile (and IE >= 10) we load more pages at once.

from viewer.js.

FredKSchott avatar FredKSchott commented on September 16, 2024

Ah, I ran that test on a desktop browser :)
But emulating a mobile browser (/w User-Agent), I'm still seeing it load entire documents on first load

screen shot 2014-10-30 at 11 41 30 am

from viewer.js.

FredKSchott avatar FredKSchott commented on September 16, 2024

Regardless, 16 is a little higher than we'd like for our project. Can we make this default configurable?

from viewer.js.

lakenen avatar lakenen commented on September 16, 2024

Yep, that's certainly possible! Unfortunately, this option controls both how many pages to load at once and how many pages are "loaded" at once. On mobile devices we also unload pages that go outside of this range to prevent memory issues. The only problem with this is that you'll probably see pages that were once loaded showing a spinner again briefly while they're being re-inserted into the DOM.

from viewer.js.

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.