myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1759991 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Date Fri, 09 Sep 2016 11:50:20 GMT
Author: lofwyr
Date: Fri Sep  9 11:50:19 2016
New Revision: 1759991

URL: http://svn.apache.org/viewvc?rev=1759991&view=rev
Log:
TOBAGO-1587: links doesn't support rightklick->newTab
* fix confirmation for normal links

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1759991&r1=1759990&r2=1759991&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Fri Sep  9 11:50:19 2016
@@ -456,38 +456,42 @@ var Tobago = {
     var commands = command.data("tobago-commands");
 
     if (commands.click) {
-      command.click(function(event) {
-        if (commands.click.confirmation == null || confirm(commands.click.confirmation))
{
-
-          var collapse = commands.click.collapse;
-          if (collapse) {
-            Tobago.Collapse.execute(collapse);
+      command.click(function (event) {
+        var confirmation = commands.click.confirmation;
+        if (confirmation != null) {
+          if (!confirm(confirmation)) {
+            event.preventDefault();
+            return;
           }
+        }
+        var collapse = commands.click.collapse;
+        if (collapse) {
+          Tobago.Collapse.execute(collapse);
+        }
 
-          if (commands.click.omit != true) {
-            var popup = commands.click.popup;
-            if (popup && popup.command == "close" && popup.immediate) {
-              Tobago.Popup.close(this);
+        if (commands.click.omit != true) {
+          var popup = commands.click.popup;
+          if (popup && popup.command == "close" && popup.immediate) {
+            Tobago.Popup.close(this);
+          } else {
+            var action = commands.click.action ? commands.click.action : jQuery(this).attr("id");
+            if (commands.click.execute || commands.click.render) {
+              Tobago.preparePartialOverlay(commands.click);
+              jsf.ajax.request(
+                  jQuery(this).attr("id"),
+                  event,
+                  {
+                    "javax.faces.behavior.event": "click",
+                    execute: commands.click.execute,
+                    render: commands.click.render
+                  });
+              event.preventDefault();
+              event.stopPropagation();
             } else {
-              var action = commands.click.action ? commands.click.action : jQuery(this).attr("id");
-              if (commands.click.execute || commands.click.render) {
-                Tobago.preparePartialOverlay(commands.click);
-                jsf.ajax.request(
-                    jQuery(this).attr("id"),
-                    event,
-                    {
-                      "javax.faces.behavior.event": "click",
-                      execute: commands.click.execute,
-                      render: commands.click.render
-                    });
-                event.preventDefault();
-                event.stopPropagation();
-              } else {
-                Tobago.submitAction(this, action, commands.click);
-              }
-              if (popup && popup.command == "close") {
-                Tobago.Popup.close(this);
-              }
+              Tobago.submitAction(this, action, commands.click);
+            }
+            if (popup && popup.command == "close") {
+              Tobago.Popup.close(this);
             }
           }
         }



Mime
View raw message