Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Commit

Permalink
Fix 68
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Smith committed May 28, 2013
1 parent ed8533e commit 3fc629f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
40 changes: 30 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,42 +248,62 @@ <h1><span id="currentFileName"></span><span id="currentFileType"></span></h1>
<section role="dialog" id="format" class="skin-organic">
<header>
<button data-click="navBack"><span class="icon icon-close">close</span></button>
<h1>Format</h1>
<h1>Tools</h1>
</header>
<div role="main" class="header-only">
<article data-type="list" style="padding: 20px;">
<article data-type="list">
<h2>Elements</h2>
<ul>
<li class="listItem noLink">
<aside class="pack-end">
<label>
<button data-click="formatDoc" data-click-action="insertOrderedList" data-click-back="true">Insert</button>
</label>
</aside>
<p class="label">Ordered list</p>
</li>
<li class="listItem noLink">
<aside class="pack-end">
<label>
<button data-click="formatDoc" data-click-action="insertUnorderedList" data-click-back="true">Insert</button>
</label>
</aside>
<p class="label">Unordered list</p>
</li>
</ul>
<h2>Formatting</h2>
<ul>
<li class="listItem">
<li class="listItem noLink">
<aside class="pack-end">
<label>
<input type="checkbox" data-type="switch" checked>
<input type="checkbox" data-type="switch">
<span></span>
</label>
</aside>
<p class="label">Bold</p>
</li>
<li class="listItem">
<li class="listItem noLink">
<aside class="pack-end">
<label>
<input type="checkbox" data-type="switch" checked>
<input type="checkbox" data-type="switch">
<span></span>
</label>
</aside>
<p class="label">Italic</p>
</li>
<li class="listItem">
<li class="listItem noLink">
<aside class="pack-end">
<label>
<input type="checkbox" data-type="switch" checked>
<input type="checkbox" data-type="switch">
<span></span>
</label>
</aside>
<p class="label">Underline</p>
</li>
<li class="listItem">
<li class="listItem noLink">
<aside class="pack-end">
<label>
<input type="checkbox" data-type="switch" checked>
<input type="checkbox" data-type="switch">
<span></span>
</label>
</aside>
Expand Down
21 changes: 13 additions & 8 deletions js/firetext.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,14 +848,16 @@ document.addEventListener('mousedown', function(event) {

function processActions(eventAttribute, target) {
if (target && target.getAttribute) {
if (target.parentNode && target.parentNode.classList && target.parentNode.classList.contains('listItem')) {
target = target.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.classList && target.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.classList && target.parentNode.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.parentNode.classList && target.parentNode.parentNode.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode.parentNode.parentNode;
if (target.hasAttribute(eventAttribute) != true) {
if (target.parentNode && target.parentNode.classList && target.parentNode.classList.contains('listItem')) {
target = target.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.classList && target.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.classList && target.parentNode.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode.parentNode;
} else if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.parentNode && target.parentNode.parentNode.parentNode.parentNode.classList && target.parentNode.parentNode.parentNode.parentNode.classList.contains('listItem')) {
target = target.parentNode.parentNode.parentNode.parentNode;
}
}
var calledFunction = target.getAttribute(eventAttribute);
if (calledFunction == 'loadToEditor') {
Expand All @@ -882,6 +884,9 @@ function processActions(eventAttribute, target) {
saveFromEditor();
} else if (calledFunction == 'formatDoc') {
formatDoc(target.getAttribute(eventAttribute + '-action'));
if (target.getAttribute(eventAttribute + '-back') == 'true') {
navBack();
}
} else if (calledFunction == 'createFromDialog') {
createFromDialog();
} else if (calledFunction == 'editDocs') {
Expand Down

0 comments on commit 3fc629f

Please sign in to comment.