Commit d88f4a90 authored by alexandre's avatar alexandre

help level 4 + links pointing to the manual

parent 7afe176c
......@@ -29,6 +29,14 @@
.wrapAll('<div class="help__inner"></div>');
});
$('h2').each(function() {
$(this)
.click(function() { $(this).toggleClass('help__section--closed'); })
.addClass('help__section help__section--closed')
.nextUntil("h2, h1")
.wrapAll('<div class="help__inner"></div>');
});
// Taken from <https://gist.github.com/mathewbyrne/1280286>
function slugify(text) {
return text
......
......@@ -1303,6 +1303,12 @@ li .icon--tag { color: white } */
padding-bottom: 14pt;
}
.help__content h4 {
font-weight: bold;
}
.help__content p + h4 { margin-top: 14pt; }
.help__content h2:first-of-type { padding-top: 0; }
.help__content :matches(p, ul, ol, pre) + :matches(p, ul, ol, pre) { margin-top: 14pt; }
......@@ -1325,6 +1331,9 @@ li .icon--tag { color: white } */
max-width: 100%;
}
.help__inner h3,
.help__inner .help__inner { margin-left: 3em; }
.help__toc {
/* position: sticky; */
/* top: 0; */
......
......@@ -611,7 +611,7 @@ window.W = window.W || {};
},
triggers: {
'click @ui.close': 'form:close'
'click @ui.close': 'form:close',
},
templateContext: function () {
......@@ -2635,6 +2635,17 @@ window.W = window.W || {};
'switch:language': 'switchLanguage'
},
events: {
'click .js-help': 'showHelp'
},
showHelp: function(event) {
var anchor = $(event.currentTarget).data("href");
var view = this.getRegion('help').currentView;
view.triggerMethod("show");
view.$el.find('iframe').get(0).contentWindow.location.hash = anchor;
},
onRender: function () {
this.showChildView('header', new W.HeaderView({model: this.model}));
this.showChildView('help', new W.helpView());
......
......@@ -9,12 +9,12 @@
</select>
</label>
<% } %>
<label><span class="label-text"><%- t('Axe') %></span>
<label><span class="label-text js-help" data-href="#axe"><%- t('Axe') %></span>
<input type="text" name="title" value="<%- title %>">
</label>
<!-- condition -->
<label class="inline"><span class="label-text"><%- t('Condition') %></span>
<label class="inline"><span class="label-text js-help" data-href="#condition"><%- t('Condition') %></span>
<input type="text" name="condition" value="<%- condition %>">
</label>
<label class="inline"><input type="checkbox" name="imperative" <% if (imperative) { %>checked<% } %>>
......@@ -22,7 +22,7 @@
</label>
<!-- terme -->
<label><span class="label-text"><%- t('Terme') %></span>
<label><span class="label-text js-help" data-href="#terme"><%- t('Terme') %></span>
<input type="text" name="terme" value="<%- terme %>">
</label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment