Display the owner and expiration time of a pad in the properties modal
This commit is contained in:
@@ -128,6 +128,38 @@ define([
|
||||
]);
|
||||
};
|
||||
|
||||
/**
|
||||
* tabs is an array containing objects
|
||||
* each object must have the following attributes:
|
||||
* - title: String
|
||||
* - content: DOMElement
|
||||
*/
|
||||
dialog.tabs = function (tabs) {
|
||||
var contents = [];
|
||||
var titles = [];
|
||||
tabs.forEach(function (tab) {
|
||||
if (!tab.content || !tab.title) { return; }
|
||||
var content = tab.content;
|
||||
var title = h('span.alertify-tabs-title', tab.title);
|
||||
$(title).click(function () {
|
||||
titles.forEach(function (t) { $(t).removeClass('alertify-tabs-active'); });
|
||||
contents.forEach(function (c) { $(c).removeClass('alertify-tabs-content-active'); });
|
||||
$(title).addClass('alertify-tabs-active');
|
||||
$(content).addClass('alertify-tabs-content-active');
|
||||
});
|
||||
titles.push(title);
|
||||
contents.push(content);
|
||||
});
|
||||
if (contents.length) {
|
||||
$(contents[0]).addClass('alertify-tabs-content-active');
|
||||
$(titles[0]).addClass('alertify-tabs-active');
|
||||
}
|
||||
return h('div.alertify-tabs', [
|
||||
h('div.alertify-tabs-titles', titles),
|
||||
h('div.alertify-tabs-contents', contents),
|
||||
]);
|
||||
};
|
||||
|
||||
UI.tokenField = function (target) {
|
||||
var t = {
|
||||
element: target || h('input'),
|
||||
|
||||
Reference in New Issue
Block a user