Changeset c6b84df for resources/assets/js
- Timestamp:
- 10/21/21 23:45:59 (3 years ago)
- Branches:
- develop, master
- Children:
- 4b7e2d3
- Parents:
- 6b95845
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/assets/js/custom.js
r6b95845 rc6b84df 7 7 }); 8 8 9 $(".edit_ document_deparment").change(function() {9 $(".edit_folder_deparment").change(function() { 10 10 var archId = $("input[name='arch_id']"); 11 11 var currentText = archId.val().split("/")[1]; 12 12 var selectedId = $(this).find('option:selected').data('dept-code'); 13 13 14 if(currentText) 14 15 archId.val(selectedId + "/" + currentText); 15 16 else 17 archId.val(selectedId + "/"); 18 }); 19 20 $(".new_folder_deparment").change(function() { 21 var archId = $("input[name='arch_id']"); 22 var selectedId = $(this).find('option:selected').data('dept-code'); 23 16 24 archId.val(selectedId + "/"); 17 25 }); … … 99 107 window.location.href = (window.location.href).replace('#', ''); 100 108 }); 109 110 function notifications() { 111 112 var url = "/dashboard/get-notifications"; 113 var _token = $("meta[name='csrf-token']").attr("content"); 114 115 $.ajax({ 116 url: url, 117 type: "post", 118 dataType: "json", 119 data: { 120 _token : _token, 121 }, 122 success: function(response) { 123 124 $(".dropdown-notifications a:not(:last)").remove(); 125 $(".dropdown-notifications-unread .nav-unread").hide(); 126 127 var l = response.length; 128 129 if(hasNew(response)) { 130 $(".dropdown-notifications .unreadNotificationsInfo").hide(); 131 $(".dropdown-notifications-unread .nav-unread").show(); 132 } 133 134 if(l == 0) { 135 $(".dropdown-notifications .unreadNotificationsInfo").show(); 136 } 137 138 if(l > 0) { 139 $(".dropdown-notifications .unreadNotificationsInfo").hide(); 140 } 141 142 for(var i=0; i<l; i++) { 143 144 var style = response[i].isRead ? "" : "background: #efefef; color: black;"; 145 146 var notificationItem = ` 147 <a href="` + response[i].url + `" class="dropdown-item d-flex" style="` + style + `;"> 148 <div> 149 ` + response[i].message + ` 150 <div class="small text-muted">` + response[i].ago + `</div> 151 </div> 152 </a>`; 153 154 $(".dropdown-notifications").prepend(notificationItem); 155 } 156 }, 157 error: function(response) { 158 console.log(response); 159 } 160 }); 161 } 101 162 102 163 $(document).on('click', '#btn-layout-builder', function () {
Note:
See TracChangeset
for help on using the changeset viewer.