(function (context, $) {

  "use strict";
  context.JK = context.JK || {};
  context.JK.AllSyncsDialog = function (app) {
    var logger = context.JK.logger;
    var rest = context.JK.Rest();
    var $dialog = null;
    var $syncsHolder = null;
    var syncViewer = null;


    function registerEvents() {

    }

    function beforeShow() {
      syncViewer.onShow()
    }

    function beforeHide() {
      syncViewer.onHide()
    }

    function initialize(invitationDialogInstance) {
      var dialogBindings = {
        'beforeShow': beforeShow,
        'beforeHide': beforeHide
      };

      app.bindDialog('all-syncs-dialog', dialogBindings);

      $dialog = $('#all-syncs-dialog');
      $syncsHolder = $dialog.find('.syncs')

      syncViewer = new context.JK.SyncViewer(app);
      syncViewer.init($syncsHolder);
      $syncsHolder.append(syncViewer.root)
      registerEvents();

    };


    this.initialize = initialize;
  }

  return this;
})(window, jQuery);