Coder Social home page Coder Social logo

Comments (4)

yaohaixiao avatar yaohaixiao commented on August 17, 2024 1

感谢您的反馈!

问题1:没有hx标签上下滚动按钮点击没有反应是BUG,我已经修复;
问题2:toolbar 的按钮是可以手动添加的,只是添加功能是在子组件 outline.toolbar 中封装的,Outline 对象还没有添加按钮的直接接口,稍后我会添加上;
目前只能通过 outline.toolbar.add() 方法添加具体用法请先查看 toolbar 的代码中的 add() 方法:
https://github.com/yaohaixiao/outline.js/blob/master/src/toolbar.js
不过目前的问题是内置的自定义图标还很少,我还需要调整一下

from outline.js.

whitebearcode avatar whitebearcode commented on August 17, 2024

感谢解答

from outline.js.

whitebearcode avatar whitebearcode commented on August 17, 2024

还有一个问题就是这个向上或向下,得手动点一下才会判断到达顶部/底部并隐藏向上或向下按钮,不知道有没有自动判断在顶部或底部的逻辑
以及离顶部/底部多高时显示向上或向下按钮

from outline.js.

yaohaixiao avatar yaohaixiao commented on August 17, 2024

添加了自定义按钮的配置 tools 和 addButton() 和 removeButton() 方法

上下按钮的控制是根据滚动距离判断的:

onToolbarUpdate({ top, min, max }) {
    const toolbar = this.toolbar
    const current = Math.ceil(top)

    if (current <= min) {
      toolbar.hide('up')
      toolbar.show('down')
    } else if (current >= max) {
      toolbar.hide('down')
      toolbar.show('up')
    } else if (current > min && current < max) {
      toolbar.show('up')
      toolbar.show('down')
    }

    return this
  }

const top = offsetTop($heading) - (stickyHeight + 10)
const min = 0
const max = this.$scrollElement.scrollHeight

from outline.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.