myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: TOBAGO-1633: TS refactoring: fix 5-stars for Safari on iPhone
Date Fri, 09 Aug 2019 14:37:18 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 7799265  TOBAGO-1633: TS refactoring: fix 5-stars for Safari on iPhone
7799265 is described below

commit 7799265a8e7ff83edda8ab99985e2d2ae057e266
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Aug 9 16:37:06 2019 +0200

    TOBAGO-1633: TS refactoring: fix 5-stars for Safari on iPhone
---
 tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-stars.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-stars.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-stars.ts
index 29d0e09..8d960d6 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-stars.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-stars.ts
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+import {DomUtils} from "./tobago-utils";
+
 class Stars extends HTMLElement {
 
   constructor() {
@@ -91,7 +93,8 @@ class Stars extends HTMLElement {
     function touchstart(event: TouchEvent) {
       /* Workaround for Safari browser on iPhone */
       const target = event.currentTarget as HTMLInputElement;
-      const sliderValue = (parseInt(target.max) / target.offsetWidth) * (event.touches[0].pageX
- slider.offsetLeft);
+      const sliderValue = (parseInt(target.max) / target.offsetWidth)
+          * (event.touches[0].pageX - DomUtils.offset(slider).left);
       if (sliderValue > parseInt(target.max)) {
         slider.value = target.max;
       } else if (sliderValue < parseInt(target.min)) {


Mime
View raw message