Subversion Repositories SmartDukaan

Rev

Rev 27754 | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function() {

        $(document).on('click', ".notification-panel", function() {
                loadNotificationfocoPanel("main-content");
        });

        $(document).on('click', "#submitEditor",
                                        function() {
                                                var editorData = CKEDITOR.instances['editor'].getData();
                                                console.log(editorData)
                                                var notificationData = {};

                                                notificationData['data'] = editorData;

                                                if (confirm("Are you sure you want to send notification!") == true) {
                                                        doPostAjaxRequestWithJsonHandler(context
                                                                        + "/notificationData", JSON
                                                                        .stringify(notificationData), function(
                                                                        response) {
                                                                if (response == 'true') {
                                                                        alert("successfully send");
                                                                        loadNotificationfocoPanel("main-content");
                                                                }
                                                        });

                                                        return false;
                                                }
                                        });
});

function loadNotificationfocoPanel(domId) {
        doGetAjaxRequestHandler(context + "/notificationPanel", function(response) {
                $('#' + domId).html(response);
                CKEDITOR.replace("editor");

        });
}