Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Вешается на событие click
- var popup = new BX.PopupWindow('popup-rejection', null, {
- lightShadow: true,
- content: '<div style="font-size: 14px; margin-top:10px;">Причина отказа</div>',
- closeIcon: {right: "20px", top: "10px"},
- titleBar: 'Причина отказа',
- zIndex: 0,
- offsetLeft: 0,
- offsetTop: 0,
- draggable: {restrict: true},
- buttons: [
- new BX.PopupWindowButton({
- text: "Установить",
- className: "popup-window-button-accept",
- events: {
- click: function () {
- var _this = this.popupWindow;
- BX.ajax.submit(BX("form_rejection"), function(data){
- var dataJson = $.parseJSON(data);
- _this.close();
- var id = location.pathname.match(/\d+/)[0];
- $.post('/local/ajax/lead/junk.php', {LEAD_ID: id, REJECTION: dataJson.ENUM_ID}, function (data) {
- location.reload(true);
- });
- });
- }
- }
- }),
- new BX.PopupWindowButton({
- text: "Отмена",
- className: "webform-button-link-cancel",
- events: {
- click: function () {
- this.popupWindow.close();
- }
- }
- })
- ]
- });
- BX.showWait();
- //Подгрузка контента страницы
- BX.ajax({
- url: '/local/ajax/lead/change_rejection_junk.php',
- method: 'POST',
- data: {},
- dataType: 'html',
- processData: true,
- scriptsRunFirst: true,
- emulateOnload: true,
- start: true,
- cache: false,
- onsuccess: function(data){
- popup.setContent(data);
- popup.show();
- BX.closeWait();
- }
- });
- //php файл
- <?
- require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
- ?>
- <div class="personal-desktop popup">
- <form action="/local/ajax/lead/change_rejection_junk.php" name="form_rejection" id="form_rejection" method="POST">
- </form>
- </div>
Add Comment
Please, Sign In to add comment