Ejemplo n.º 1
0
    createdCallback: function() {
      this.setAttribute('role', 'listbox');
      this.setAttribute('aria-multiselectable', 'true');

      mozL10n.setAttributes(this.messageEmptyText, this.dataset.emptyL10nId);

      containerListen(this.vScrollContainer, 'click',
                      this.onClickMessage.bind(this));
    },
Ejemplo n.º 2
0
    createdCallback: function() {
      containerListen(this.querySelector('.filter'), 'click',
                      this.onSearchFilterClick.bind(this));
      this.searchFilterTabs = this.querySelectorAll('.filter [role="tab"]');

      this.isFirstTimeVisible = true;

      // Binding "this" to some functions as they are used for event listeners.
      this._folderChanged = this._folderChanged.bind(this);

      this.msgVScroll.on('emptyLayoutShown', function() {
        this.editBtn.disabled = true;
      }.bind(this));

      this.msgVScroll.on('emptyLayoutHidden', function() {
        this.editBtn.disabled = false;
      }.bind(this));

      this.msgVScroll.on('messagesChange', function(message, index) {
        this.updateMatchedMessageDom(false, message);
      }.bind(this));

      this.msgVScroll.on('messagesComplete', function(newEmailCount) {
        // Search does not trigger normal conditions for a folder changed,
        // so if vScroll is missing its data, set it up now.
        if (!this.msgVScroll.vScroll.list) {
          this.msgVScroll.vScroll.setData(this.msgVScroll.listFunc);
        }
      }.bind(this));

      var vScrollBindData = (function bindSearch(model, node) {
        model.element = node;
        node.message = model.header;
        this.updateMatchedMessageDom(true, model);
      }).bind(this);
      this.msgVScroll.init(this.scrollContainer,
                           vScrollBindData,
                           defaultSearchVScrollData);

      this._topBar = new MessageListTopBar(
        this.querySelector('.message-list-topbar')
      );
      this._topBar.bindToElements(this.scrollContainer,
                                  this.msgVScroll.vScroll);
    },