airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [08/11] airavata-php-gateway git commit: AIRAVATA-2228 Prevent autorefresh when dialog open
Date Wed, 23 Nov 2016 15:49:44 GMT
AIRAVATA-2228 Prevent autorefresh when dialog open


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/90bf323e
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/90bf323e
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/90bf323e

Branch: refs/heads/develop
Commit: 90bf323ef2b536bfa9f16bfb71f61be229149e5d
Parents: 4c01c62
Author: Marcus Christie <machrist@iu.edu>
Authored: Tue Nov 22 19:09:48 2016 -0500
Committer: Marcus Christie <machrist@iu.edu>
Committed: Tue Nov 22 19:09:48 2016 -0500

----------------------------------------------------------------------
 app/views/experiment/summary.blade.php | 13 +++++++++++++
 public/js/sharing/share.js             | 18 ++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/90bf323e/app/views/experiment/summary.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/summary.blade.php b/app/views/experiment/summary.blade.php
index 32b11d8..2135f33 100755
--- a/app/views/experiment/summary.blade.php
+++ b/app/views/experiment/summary.blade.php
@@ -18,6 +18,7 @@
     @else
         var autoRefresh = false;
     @endif
+    var isDialogOpen = false;
 
     var currentJobStatuses = {};
     @foreach( $expVal["jobDetails"] as $index => $jobDetail)
@@ -50,6 +51,12 @@
                 url: "{{URL::to('/') }}/experiment/summary",
                 data: {expId: "{{ Input::get('expId') }}", isAutoRefresh : autoRefresh },
                 success: function (data) {
+
+                    // Don't refresh the page if a dialog is open
+                    if (isDialogOpen) {
+                        return;
+                    }
+
                     data = $.parseJSON( data);
 
                     // Convert jobDetails to a map of jobStatuses
@@ -90,5 +97,11 @@
         console.log(autoRefresh);
         window.location.replace("{{URL::to('/') }}/experiment/summary?" + "expId=" + "{{
Input::get('expId') }}"+"&"+ "isAutoRefresh=" + autoRefresh);
     });
+
+    $('.modal, #share-box').on('show', function (e) {
+        isDialogOpen = true;
+    }).on('hide', function (e) {
+        isDialogOpen = false;
+    });
 </script>
 @stop

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/90bf323e/public/js/sharing/share.js
----------------------------------------------------------------------
diff --git a/public/js/sharing/share.js b/public/js/sharing/share.js
index e87598a..ed5d160 100755
--- a/public/js/sharing/share.js
+++ b/public/js/sharing/share.js
@@ -7,7 +7,8 @@
 var createThumbnails;
 
 $(function() {
-    var comparator_map, comparator, $original_shared_list, $revoke_list, share_settings;
+    var comparator_map, comparator, $original_shared_list, $revoke_list, share_settings,
+        showSharingModal, hideSharingModal;
     comparator_map = {
             "username": usernameComparator,
             "firstlast": firstLastComparator,
@@ -76,8 +77,13 @@ $(function() {
         //$('.group-thumbnail').show();
     };
 
-
-
+    // Dispatch hide/show events when modal hides/shows
+    showSharingModal = function() {
+        $('#share-box').animate({top: "1%"}).trigger("show");
+    };
+    hideSharingModal = function() {
+        $('#share-box').animate({top: '100%'}).trigger("hide");
+    };
 
 
     /* Share box event handlers */
@@ -136,7 +142,7 @@ $(function() {
             });
         }
         $original_shared_list = $('#share-box-share').children();
-        $('#share-box').animate({top: "1%"});
+        showSharingModal();
         return false;
     });
 
@@ -279,7 +285,7 @@ $(function() {
             });
             $share_list.detach().appendTo($('#shared-users'));
         }
-        $('#share-box').animate({top: '100%'});
+        hideSharingModal();
         $update_list.removeClass('sharing-to-update');
         $update_list.addClass('updated');
     };
@@ -357,7 +363,7 @@ $(function() {
         $('.sharing-to-update').find('.sharing-thumbnail-access-text').text(access_text[access_enum.NONE]).show();
         $('.sharing-to-update').find('.sharing-thumbnail-unshare').hide();
         $('.sharing-to-update').addClass('share-box-users-item').removeClass('sharing-to-update
share-box-share-item');
-        $('#share-box').animate({top: "100%"});
+        hideSharingModal();
         $('.order-results-selector').trigger('change');
         return false;
     });


Mime
View raw message