Sha256: 5ede130b2a115b4646eb8f08b128a30500881add025e2156e2a64bd43b0b7172

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

(function(){

spud.admin.modal = {

  displayWithOptions: function(options){
    var modal = $('#modal_window');
    if(options.title){
      modal.find('.modal-title').text(options.title);
    }
    if(options.html){
      modal.find('.modal-body').html(options.html);
    }
    var defaultFooter = modal.find('.modal-footer-default');
    if(options.buttons){
      var newFooter = defaultFooter.clone();
      newFooter.addClass('modal-footer-additional');
      newFooter.find('.form-submit').remove();
      for(var key in options.buttons){
        newFooter.append('<button class="btn '+key+'">'+options.buttons[key]+'</button>');
      }
      defaultFooter.hide();
      modal.append(newFooter);
    }
    else{
      defaultFooter.show();
    }
    modal.modal('show');
  },

  hide: function(){
    var modal = $('#modal_window');
    modal.modal('hide');
  }

};

})();

function displayModalDialogWithOptions(options){
  console.warn('displayModalDialogWithOptions() is deprecated, please use spud.admin.modal.displayWithOptions.');
  spud.admin.modal.displayWithOptions(options);
}

function hideModalDialog(){
  console.warn('hideModalDialog() is deprecated, please use spud.admin.modal.hide');
  spud.admin.modal.hide();
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tb_core-1.2.8 app/assets/javascripts/admin/core/modal.js
tb_core-1.2.7 app/assets/javascripts/admin/core/modal.js
tb_core-1.2.6 app/assets/javascripts/admin/core/modal.js
tb_core-1.2.4 app/assets/javascripts/admin/core/modal.js
tb_core-1.2.3 app/assets/javascripts/admin/core/modal.js