page_notification

This code can be found in app.js
Common initialization function (to be called from each page)


Office.initialize = function (reason) { 
   $(document).ready(function () {
      page_AddNotification();

search "build your first excel add-in" github


var app = (function () {
   "use strict"
   var app = {};

    page_AddNotification = 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');
        };
    };
   return app;
}) ();


   Office.initialize = function(reason) { 
      $(document).ready(function) () {
         var element = document.querySelector("ms-MessageBanner');
         messageBanner = new fabric.MessageBanner(element);
         messageBanner.hideBanner();

         $('#dialog-button').click(event_showDialog);
      } ) ;


   function fn_showNotification (header, content) { 
      $('#notification-message-header').text(header);
      $('#notification-message-body').text(text);
      messageBanner.showBanner();
      messageBanner.toggleExpansion();
   }


© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Prev