GithubHelp home page GithubHelp logo

Comments (3)

btheado avatar btheado commented on July 28, 2024

I don't have any experience with this DOM API, but from what I read, an IntersectionObserver can be used to execute code when a dom element becomes visible. With that, the clientWidth could be calculated only when the innerwiki dom is visible and thereby get the correct value.

Ideas for workarounds until the issue is fixed:

  • Don't use zoomin view or tabs macro (as you mentioned at TW talk
  • Add a refresh button to make it a little easier to refresh the innerwiki:
<$button actions="<$action-listops $tiddler='$:/temp/innerwiki-refresh' $field=text $subfilter=':and[cycle[on off]]'/>">Refresh innerwiki</$button>
<$list name=refresh filter="hello.js $:/temp/innerwiki-refresh :and[get[text]join[]]">
<$innerwiki width="600" height="400" style="width:100%;">
[...]

from tiddlywiki5.

Jermolene avatar Jermolene commented on July 28, 2024

Thanks @ittayd @btheado. I've made some experiments in the past and found IntersectionObserver awkward to use within a TW widget. A simpler alternative fix might be to adjust the scaling and anchor positions when there is a refresh. That approach would not be able to detect changes to the innerwiki size triggered by the window size changing, but I think it would fix the specific problem with the zooming storyview described in the OP.

from tiddlywiki5.

ittayd avatar ittayd commented on July 28, 2024

I'd like to add that i don't know why scaling is required. If I want to clip some content I usually want just that. Perhaps instead of trying to calculate scaling automatically, there can be an attribute the user can set if they wish scaling. It can be a fixed number or 'auto' (in which case the existing calculation will be used)

from tiddlywiki5.

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.