mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
This commit is contained in:
parent
d6656dffc0
commit
560ceffaaf
@ -1,3 +1,8 @@
|
||||
// Hack for bootstrap issue with IE10. https://github.com/twbs/bootstrap/issues/3672
|
||||
if ($.browser.msie && $.browser.version > 9) {
|
||||
$('.modal').removeClass('fade');
|
||||
}
|
||||
|
||||
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallback, bStandingRedraw) {
|
||||
if (typeof sNewSource != 'undefined' && sNewSource != null) {
|
||||
oSettings.sAjaxSource = sNewSource;
|
||||
@ -100,7 +105,7 @@ jQuery.fn.dialogForm = function (options) {
|
||||
});
|
||||
|
||||
// Success actions ...
|
||||
var onSuccess = function (jqXHR, textStatus,data) {
|
||||
var onSuccess = function (jqXHR, textStatus, data) {
|
||||
if (options.redirect) {
|
||||
var resourceId = jqXHR.getResponseHeader("ResourceId");
|
||||
var redirectUrl = options.redirect;
|
||||
@ -117,7 +122,7 @@ jQuery.fn.dialogForm = function (options) {
|
||||
};
|
||||
|
||||
// On error message
|
||||
var onFailure = function(jqXHR,textStatus, data){
|
||||
var onFailure = function (jqXHR, textStatus, data) {
|
||||
var errors = JSON.parse(jqXHR.responseText);
|
||||
// Mark fields with errors ...
|
||||
var fieldErrors = errors.fieldErrors;
|
||||
@ -148,12 +153,12 @@ jQuery.fn.dialogForm = function (options) {
|
||||
$(acceptBtn).button('loading');
|
||||
var dialogElem = this;
|
||||
jQuery.ajax(url, {
|
||||
async:false,
|
||||
dataType:'json',
|
||||
data:JSON.stringify(formData),
|
||||
type:options.type ? options.type : 'POST',
|
||||
contentType:"application/json; charset=utf-8",
|
||||
statusCode:{
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: JSON.stringify(formData),
|
||||
type: options.type ? options.type : 'POST',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
statusCode: {
|
||||
200: onSuccess,
|
||||
201: onSuccess,
|
||||
204: onSuccess,
|
||||
@ -227,12 +232,12 @@ function updateStarred(spanElem) {
|
||||
}
|
||||
|
||||
jQuery.ajax("c/restful/maps/" + mapId + "/starred", {
|
||||
async:false,
|
||||
dataType:'json',
|
||||
data:"" + starred,
|
||||
type:'PUT',
|
||||
contentType:"text/plain",
|
||||
success:function () {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: "" + starred,
|
||||
type: 'PUT',
|
||||
contentType: "text/plain",
|
||||
success: function () {
|
||||
if (starred) {
|
||||
$(spanElem).removeClass('starredOff');
|
||||
$(spanElem).addClass('starredOn');
|
||||
@ -241,7 +246,7 @@ function updateStarred(spanElem) {
|
||||
$(spanElem).addClass('starredOff');
|
||||
}
|
||||
},
|
||||
error:function (jqXHR, textStatus, errorThrown) {
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$('#messagesPanel div').text(errorThrown).parent().show();
|
||||
}
|
||||
});
|
||||
@ -263,8 +268,8 @@ $(function () {
|
||||
$("#newBtn").click(
|
||||
function () {
|
||||
$("#new-dialog-modal").dialogForm({
|
||||
redirect:"c/maps/{header.resourceId}/edit",
|
||||
url:"c/restful/maps"
|
||||
redirect: "c/maps/{header.resourceId}/edit",
|
||||
url: "c/restful/maps"
|
||||
});
|
||||
});
|
||||
|
||||
@ -283,8 +288,8 @@ $(function () {
|
||||
|
||||
// Initialize dialog ...
|
||||
$("#duplicate-dialog-modal").dialogForm({
|
||||
redirect:"c/maps/{header.resourceId}/edit",
|
||||
url:"c/restful/maps/" + mapId
|
||||
redirect: "c/maps/{header.resourceId}/edit",
|
||||
url: "c/restful/maps/" + mapId
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -309,16 +314,16 @@ $(function () {
|
||||
|
||||
// Initialize dialog ...
|
||||
$("#rename-dialog-modal").dialogForm({
|
||||
type:'PUT',
|
||||
clearForm:false,
|
||||
postUpdate:function (reqBodyData) {
|
||||
type: 'PUT',
|
||||
clearForm: false,
|
||||
postUpdate: function (reqBodyData) {
|
||||
tableElem.dataTableExt.removeSelectedRows();
|
||||
|
||||
rowData.title = reqBodyData.title;
|
||||
rowData.description = reqBodyData.description;
|
||||
dataTable.fnAddData(JSON.parse(JSON.stringify(rowData)));
|
||||
},
|
||||
url:"c/restful/maps/" + mapId
|
||||
url: "c/restful/maps/" + mapId
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -331,12 +336,12 @@ $(function () {
|
||||
if (mapIds.length > 0) {
|
||||
// Initialize dialog ...
|
||||
$("#delete-dialog-modal").dialogForm({
|
||||
type:'DELETE',
|
||||
postUpdate:function () {
|
||||
type: 'DELETE',
|
||||
postUpdate: function () {
|
||||
// Remove old entry ...
|
||||
tableUI.dataTableExt.removeSelectedRows();
|
||||
},
|
||||
url:"c/restful/maps/batch?ids=" + jQuery.makeArray(mapIds).join(',')
|
||||
url: "c/restful/maps/batch?ids=" + jQuery.makeArray(mapIds).join(',')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user