Last active
January 3, 2016 05:39
-
-
Save wyster/8417099 to your computer and use it in GitHub Desktop.
CMS jQuery tiggers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @type {string} form identifier | |
*/ | |
var form = '#mainform'; | |
(function($) { | |
/** | |
* @param {object} event - jQuery Event Object (http://api.jquery.com/category/events/event-object/) | |
* @param {object} result | |
*/ | |
$(form).on("cmsFormResult", function(event, result) { | |
// Используем если нужно отключить дальнейшую системную обработку | |
event.preventDefault(); | |
// Чтобы посмотреть все доступные ключи используем console.debug(result); | |
if (result.isValid) { | |
alert("Данные успешно сохранены"); | |
} else { | |
alert("Произошла ошибка, данные не сохранены"); | |
} | |
}); | |
})(cmsSystemJQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(function() { | |
/** | |
* @type {object} | |
*/ | |
var container = $("#container"); | |
/** | |
* @type {object} | |
*/ | |
var container2 = $("#container2"); | |
/** | |
* @param {object} event - jQuery Event Object (http://api.jquery.com/category/events/event-object/) | |
* @param {object} result | |
*/ | |
container.on("cmsGalleryAlbumById", function(event, result) { | |
// Используем если нужно отключить дальнейшую системную обработку | |
event.preventDefault(); | |
console.debug(result); | |
}); | |
/** | |
* @param {object} event - jQuery Event Object (http://api.jquery.com/category/events/event-object/) | |
* @param {object} result | |
*/ | |
container.on("cmsGalleryAlbumsList", function(event, result) { | |
// Используем если нужно отключить дальнейшую системную обработку | |
event.preventDefault(); | |
console.debug(result); | |
}); | |
/** | |
* Получение альбома по ID | |
*/ | |
container.cmsGalleryAlbumById(1); | |
/** | |
* Получение всех альбомов | |
*/ | |
container2.cmsGalleryAlbumsList(); | |
}); | |
})(cmsSystemJQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment