Browse Source

Logout confirmation, rename var

Vova Tkach 6 years ago
parent
commit
ee432ea420
4 changed files with 17 additions and 15 deletions
  1. 16 14
      assets/cp.scripts.js
  2. 0 0
      assets/cp.scripts.js.go
  3. 0 0
      assets/tmpl.cp.base.go
  4. 1 1
      assets/tmpl.cp.base.html

+ 16 - 14
assets/cp.scripts.js

@@ -36,22 +36,24 @@ function AjaxFail() {
 	window.location.reload(false);
 }
 
-function ActionIndexUserLogout() {
-	$.ajax({
-		type: "POST",
-		url: '/cp/',
-		data: {
-			action: 'index-user-logout',
-		}
-	}).done(function(data) {
-		AjaxDone(data)
-	}).fail(function() {
-		AjaxFail();
-	});
+function ActionIndexUserLogout(message) {
+	if(confirm(message)) {
+		$.ajax({
+			type: "POST",
+			url: '/cp/',
+			data: {
+				action: 'index-user-logout',
+			}
+		}).done(function(data) {
+			AjaxDone(data)
+		}).fail(function() {
+			AjaxFail();
+		});
+	}
 }
 
-function ActionDataTableDelete(object, action, id, msg) {
-	if(confirm(msg)) {
+function ActionDataTableDelete(object, action, id, message) {
+	if(confirm(message)) {
 		$.ajax({
 			type: "POST",
 			url: '/cp/',

File diff suppressed because it is too large
+ 0 - 0
assets/cp.scripts.js.go


File diff suppressed because it is too large
+ 0 - 0
assets/tmpl.cp.base.go


+ 1 - 1
assets/tmpl.cp.base.html

@@ -82,7 +82,7 @@
 						<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nbAccountDropdown">
 							<a class="dropdown-item" href="javascript:;" data-toggle="modal" data-target="#sys-modal-user-settings" data-backdrop="static" data-keyboard="false">My Profile</a>
 							<div class="dropdown-divider"></div>
-							<a class="dropdown-item" href="javascript:ActionIndexUserLogout();">Logout</a>
+							<a class="dropdown-item" href="javascript:ActionIndexUserLogout('Are you sure want to logout?');">Logout</a>
 						</div>
 					</li>
 				</ul>

Some files were not shown because too many files changed in this diff