Skip to content
Fossil Changes To branch/copybtn.js-responsive
Login

Changes To branch/copybtn.js-responsive

Initial version of "branch/copybtn.js-responsive"




















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
* The Copy Buttons (to copy text to the clipboard in the web UI) are changed
  from `<span>` elements to `<button>` elements containing a nested `<span>`.
  This allows definition of the "pushed" look through `button:active` by CSS,
  obsoleting the corresponding JS code and the hard-coded `opacity` animation.
  Like this, the transition from "normal" to "pushed" already happens on the
  `onmousedown` event instead of on the `onmouseup` event (when the click event
  is "complete" and triggers the `onclick` handler), resulting in a more
  responsive user experience -- the main motivation behind this change.

* All JS code paths to initialize Copy Buttons automatically create the nested
  `<span>` element if the `<button>` doesn't yet have any child nodes. However,
  where possible, the nested `<span>` is already generated on the server-side as
  static HTML so that the Copy Buttons are still visible in case of JS errors
  (which probably only makes sense for Fossil JS hackers).

* The layout of the new `<button>`-based variant is compatible with the previous
  `<span>`-based variant in Chrome/FF/IE, except for some barely noticeable
  *horizontal* deviation of a single pixel or two, likely due to font size
  differences of the `<button>` element (despite `font-size: inherit`).