← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21167: event-capture: stop propagation of event when downloading file from event-grid

 

------------------------------------------------------------
revno: 21167
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-11-23 10:52:35 +0100
message:
  event-capture: stop propagation of event when downloading file from event-grid
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-11-19 11:12:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-11-23 09:52:35 +0000
@@ -1155,7 +1155,11 @@
         return '';        
     };
     
-    $scope.downloadFile = function(eventUid, dataElementUid) {        
-        $window.open('../api/events/files?eventUid=' + eventUid +'&dataElementUid=' + dataElementUid, '_blank', '');  
+    $scope.downloadFile = function(eventUid, dataElementUid, e) {        
+        $window.open('../api/events/files?eventUid=' + eventUid +'&dataElementUid=' + dataElementUid, '_blank', '');
+        if(e){
+            e.stopPropagation();
+            e.preventDefault();
+        }
     };
 });
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2015-11-16 15:48:46 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2015-11-23 09:52:35 +0000
@@ -396,6 +396,14 @@
     cursor: inherit;
     display: block;
 }
+
+.contextMenuItems .divider {
+    height: 1px;
+    margin: 5px 0;
+    overflow: hidden;
+    background-color: #e5e5e5
+}
+
 /*.file-input input[readonly] {
     background-color: white !important;
     cursor: text !important;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2015-11-19 11:12:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2015-11-23 09:52:35 +0000
@@ -42,6 +42,7 @@
                 <ul id="contextMenuItems" class="contextMenuItems">
                     <li><a href ng-click="showEditEventInFull()"><i class="fa fa-edit"></i>&nbsp;&nbsp;{{'edit'| translate}}</a></li>
                     <li><a href ng-click="showEditEventInGrid()"><i class="fa fa-edit"></i>&nbsp;&nbsp;{{'edit_in_grid'| translate}}</a></li>
+                    <li class="divider">&nbsp;</li>
                     <li ng-if="userAuthority.canDeleteEvent"><a href ng-click="removeEvent()"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;{{'remove'| translate}}</a></li>                                       
                 </ul>
             </div>
@@ -136,7 +137,7 @@
                                             <span ng-if="dhis2Event[eventGridColumn.id]"><i class="fa fa-check"></i></span>
                                         </span>
                                         <span ng-switch-when="FILE_RESOURCE">
-                                            <a href ng-click="downloadFile(dhis2Event.event, eventGridColumn.id)">{{fileNames[dhis2Event.event][eventGridColumn.id]}}</a>
+                                            <a href ng-click="downloadFile(dhis2Event.event, eventGridColumn.id, $event)">{{fileNames[dhis2Event.event][eventGridColumn.id]}}</a>
                                         </span>
                                         <span ng-switch-default>
                                             {{dhis2Event[eventGridColumn.id]}}
@@ -326,7 +327,7 @@
                                                 <div ng-switch-when="FILE_RESOURCE">                                
                                                     <div class="input-group">
                                                         <div class="form-control">
-                                                            <a href ng-click="downloadFile(currentEvent.event, eventGridColumn.id)">{{fileNames[eventGridColumn.id]}}</a>
+                                                            <a href ng-click="downloadFile(currentEvent.event, eventGridColumn.id, $event)">{{fileNames[eventGridColumn.id]}}</a>
                                                         </div>
                                                         <span class="input-group-btn">
                                                             <span class="btn btn-primary btn-file">