`textVisible` loader option is inadequately named/documented

未关闭
#122 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@johnbender 已经在做这个了。

开始于 2013年6月12日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript, jquery
领域
documentation

调研方向

从 api.jquerymobile.com/page-loading/#option-textVisible 中的 textVisible 选项文档开始,并将其与此 issue 中的 loader 输出示例进行比较。检查配置 html 和 textVisible 时如何选择 ui-loader-default 和 ui-loader-verbose 类;完成的标准是清楚地记录这一行为,或就命名/API 变更达成决定。

由索引模型根据 Issue 内容生成。

描述

Issue description

Reading the documentation, it seems like the textVisible loader option only controls whether the supplied text will be shown:

If true, the text value will be used under the spinner.

However, when using the html option to specify custom HTML for the loader, it turns out that the textVisible option still controls whether the loader is shown as simple circle or as a bigger box (with space for text or other content).

This is not clear from the documentation, so it would help to add information about this. The underlying problem is, however, that the naming for the textVisible option does not make clear that it controls more things than only showing text. It might be better to add another option to control whether the loader is shown as circle or as a box (or rename this option to something more appropriate).

Test code

Specifically look at the latest class name. This class seems to determine whether the loader is just a circle (ui-loader-default) or a bigger box (ui-loader-verbose).

Default loader
Output: circle loader
<div class="ui-loader ui-corner-all ui-body-a ui-loader-default">
    <span class="ui-icon ui-icon-loading"></span>
    <h1>loading</h1>
</div>
Loader with text
Configuration
$.mobile.loader.prototype.options.text = 'Hi there';
$.mobile.loader.prototype.options.textVisible = true;
Output: box loader
<div class="ui-loader ui-corner-all ui-body-a ui-loader-verbose">
    <span class="ui-icon ui-icon-loading"></span>
    <h1>Hi there</h1>
</div>
Loader with custom HTML
Configuration
$.mobile.loader.prototype.options.html = 'Hello';
Output: circle loader (why?)
<div class="ui-loader ui-corner-all ui-body-a ui-loader-default">
    Hello
</div>
Loader with custom HTML and textVisible option
Configuration
$.mobile.loader.prototype.options.html = 'Hello';
$.mobile.loader.prototype.options.textVisible = true;
Output: box loader (why?)
<div class="ui-loader ui-corner-all ui-body-a ui-loader-verbose">
    Hello
</div>

jQuery Mobile and jQuery core version used

  • JS Bin test page: jQuery Mobile latest and jQuery 1.9.0.

Other relevant information

Please let me know if test pages are required, in that case I will add them to this issue.

主要语言
HTML
星标
55
派生
57
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jquery/api.jquerymobile.com 的其他 Issue

查看 jquery/api.jquerymobile.com 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。