From c53671df4893039d5b682fc8275bb832ce1d4dd8 Mon Sep 17 00:00:00 2001 From: opanmustopah Date: Tue, 6 Nov 2018 15:32:39 +0700 Subject: [PATCH 1/2] Remove nowrap for API title and increase font-size for API url --- assets/api.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/api.css b/assets/api.css index 4bcd88e..c720e22 100644 --- a/assets/api.css +++ b/assets/api.css @@ -60,7 +60,7 @@ padding: 0; font-size: 16px; font-weight: normal; - white-space: nowrap; + /* white-space: nowrap; */ line-height: 28px; height: 26px; } @@ -68,7 +68,7 @@ .api-container .api-header span { display: block; color: #266D9E; - font-size: 11px; + font-size: 12px; padding: 0px 8px; border: 1px solid #266D9E; white-space: nowrap; @@ -79,7 +79,7 @@ .api-container .api-content { height: 0px; - overflow: hidden; + overflow: hidden; } .api-container .api-content div { From 6b515b95b76d262fe7ca6114ae58c1ae9299c67a Mon Sep 17 00:00:00 2001 From: opanmustopah Date: Tue, 6 Nov 2018 15:43:48 +0700 Subject: [PATCH 2/2] Revert previous commit, add title option instead --- assets/api.css | 4 ++-- index.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/api.css b/assets/api.css index c720e22..5fd2ecc 100644 --- a/assets/api.css +++ b/assets/api.css @@ -60,7 +60,7 @@ padding: 0; font-size: 16px; font-weight: normal; - /* white-space: nowrap; */ + white-space: nowrap; line-height: 28px; height: 26px; } @@ -68,7 +68,7 @@ .api-container .api-header span { display: block; color: #266D9E; - font-size: 12px; + font-size: 11px; padding: 0px 8px; border: 1px solid #266D9E; white-space: nowrap; diff --git a/index.js b/index.js index 5018f3c..7b1c373 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ function element (tag, options, container) { const cls = options.class const text = options.text const html = options.html + const title = options.title const el = document.createElement(tag) el.classList.add(cls) @@ -19,6 +20,9 @@ function element (tag, options, container) { if (html != null) { el.innerHTML = html } + if (title != null) { + el.title = title + } return el } @@ -40,7 +44,7 @@ module.exports = { const header = element('div', { class: 'api-header' }, container) if (block.kwargs.method) { element('small', { text: block.kwargs.method, class: block.kwargs.method.toLowerCase() }, header) } element('h2', { text: block.args[0] }, header) - if (block.kwargs.url) { element('span', { text: block.kwargs.url }, header) } + if (block.kwargs.url) { element('span', { text: block.kwargs.url, title: block.kwargs.url }, header) } // Create content section const content = element('div', { class: 'api-content' }, container)