Skip to content

如果上传按钮在初始化之前是隐藏的,会出现触发选择文件按钮的高度问题 #43

@lvshuang

Description

@lvshuang

如果我的上传按钮最开始是隐藏的,outerHeight()只能得到按钮的border+padding的高度,在按钮展示以后,当鼠标移动到上传按钮,会执行一下代码:

// bind events
  Uploader.prototype.bind = function() {
    var self = this;
    var $trigger = $(self.settings.trigger);
    $trigger.mouseenter(function() {
      self.form.css({
        top: $trigger.offset().top,
        left: $trigger.offset().left,
        width: $trigger.outerWidth(),
        height: $trigger.outerHeight()
      });
    });
    self.bindInput();
  };

这里重新计算了form的高度,所以form高度不会出现问题,但是没有重新计算触发选择文件按钮的高度,导致按钮不容易点击到(高度太小),这个地方应该重新计算高度!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions