none
Would like more info on App.showNotification Method RRS feed

  • Question

  • Hello,

    I stumbled on a case where I passed in two parameters to app.showNotification and I got some interesting results. I was wondering if there was a page that showed the overloads of that method?

    John


    John Donnelly

    Sunday, June 1, 2014 5:00 PM

Answers

  • Hi John,

    If you click "Go To Defintion" after selecting this function:

    You will find this function is defined in App.js.

    app.initialize = function () {
            $('body').append(
                '<div id="notification-message">' +
                    '<div class="padding">' +
                        '<div id="notification-message-close"></div>' +
                        '<div id="notification-message-header"></div>' +
                        '<div id="notification-message-body"></div>' +
                    '</div>' +
                '</div>');
    
            $('#notification-message-close').click(function () {
                $('#notification-message').hide();
            });
    
    
            // After initialization, expose a common notification function
            app.showNotification = function (header, text) {
                $('#notification-message-header').text(header);
                $('#notification-message-body').text(text);
                $('#notification-message').slideDown('fast');
            };
    };

    While the app initialized, there would be a div created to display information.

    You could change the function of showNotification, also you could define the function again at the end.

    app.showNotification = function (header, text) {
                $('#notification-message-header').text(header + "-overload");
                $('#notification-message-body').text(text + "-overload");
                $('#notification-message').slideDown('fast');
            };

    After that, you will find showNotification changed.

    Hope this helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by J_Donnelly Monday, June 2, 2014 1:35 PM
    Monday, June 2, 2014 8:30 AM
    Moderator

All replies

  • Hi John,

    If you click "Go To Defintion" after selecting this function:

    You will find this function is defined in App.js.

    app.initialize = function () {
            $('body').append(
                '<div id="notification-message">' +
                    '<div class="padding">' +
                        '<div id="notification-message-close"></div>' +
                        '<div id="notification-message-header"></div>' +
                        '<div id="notification-message-body"></div>' +
                    '</div>' +
                '</div>');
    
            $('#notification-message-close').click(function () {
                $('#notification-message').hide();
            });
    
    
            // After initialization, expose a common notification function
            app.showNotification = function (header, text) {
                $('#notification-message-header').text(header);
                $('#notification-message-body').text(text);
                $('#notification-message').slideDown('fast');
            };
    };

    While the app initialized, there would be a div created to display information.

    You could change the function of showNotification, also you could define the function again at the end.

    app.showNotification = function (header, text) {
                $('#notification-message-header').text(header + "-overload");
                $('#notification-message-body').text(text + "-overload");
                $('#notification-message').slideDown('fast');
            };

    After that, you will find showNotification changed.

    Hope this helps.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by J_Donnelly Monday, June 2, 2014 1:35 PM
    Monday, June 2, 2014 8:30 AM
    Moderator
  • That is good information and very thorough. Thanks!

    John Donnelly

    Monday, June 2, 2014 1:35 PM