sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [sling-org-apache-sling-app-cms] branch master updated: Adding support for double clicking items to open them
Date Thu, 02 May 2019 05:55:32 GMT
This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to refs/heads/master by this push:
     new 05f751d  Adding support for double clicking items to open them
05f751d is described below

commit 05f751d369801dea50f0c05a7ddfc7abb20382fd
Author: Dan Klco <dklco@apache.org>
AuthorDate: Wed May 1 22:55:20 2019 -0700

    Adding support for double clicking items to open them
---
 ui/src/main/frontend/src/js/cms.table.js                             | 5 +++++
 .../jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp     | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ui/src/main/frontend/src/js/cms.table.js b/ui/src/main/frontend/src/js/cms.table.js
index 156f24a..45bc48f 100644
--- a/ui/src/main/frontend/src/js/cms.table.js
+++ b/ui/src/main/frontend/src/js/cms.table.js
@@ -33,6 +33,11 @@
                 });
                 this.classList.add('is-selected');
                 document.querySelector('.actions-target').innerHTML = this.querySelector('.cell-actions').innerHTML;
+            },
+            dblclick: function () {
+                if(this.querySelector('.item-link')){
+                    window.location = this.querySelector('.item-link').href;
+                }
             }
         }
     });
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp
index 0cbf2bf..0c233d6 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp
@@ -21,7 +21,7 @@
     <c:set var="colValue" value="${resource.name}" />
     <c:choose>
         <c:when test="${colConfig.valueMap.link}">
-            <a href="${colConfig.valueMap.prefix}${resource.path}">
+            <a class="item-link" href="${colConfig.valueMap.prefix}${resource.path}">
                 <sling:encode value="${colValue}" mode="HTML" />
             </a>
         </c:when>


Mime
View raw message