Some last FappeTyme/WerkTyme tweaks

This commit is contained in:
Zixaphir 2013-12-16 18:36:09 -07:00
parent 68bc40cc45
commit 57f7d899ec
3 changed files with 7 additions and 15 deletions

View File

@ -9795,7 +9795,7 @@
continue; continue;
} }
lc = type.toLowerCase(); lc = type.toLowerCase();
el = $.el('a', { FappeTyme[lc] = el = $.el('a', {
href: 'javascript:;', href: 'javascript:;',
id: "" + lc + "Tyme", id: "" + lc + "Tyme",
title: "" + type + " Tyme", title: "" + type + " Tyme",
@ -9809,9 +9809,7 @@
name: "" + lc name: "" + lc
})); }));
Header.addShortcut(el, true); Header.addShortcut(el, true);
if (Conf[lc]) { FappeTyme.cb.set(lc);
FappeTyme.cb.set(lc);
}
} }
return Post.callbacks.push({ return Post.callbacks.push({
name: 'Fappe Tyme', name: 'Fappe Tyme',
@ -9826,7 +9824,6 @@
}, },
cb: { cb: {
set: function(type) { set: function(type) {
FappeTyme[type].checked = Conf[type];
return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme"); return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
}, },
toggle: function() { toggle: function() {

View File

@ -9781,7 +9781,7 @@
continue; continue;
} }
lc = type.toLowerCase(); lc = type.toLowerCase();
el = $.el('a', { FappeTyme[lc] = el = $.el('a', {
href: 'javascript:;', href: 'javascript:;',
id: "" + lc + "Tyme", id: "" + lc + "Tyme",
title: "" + type + " Tyme", title: "" + type + " Tyme",
@ -9795,9 +9795,7 @@
name: "" + lc name: "" + lc
})); }));
Header.addShortcut(el, true); Header.addShortcut(el, true);
if (Conf[lc]) { FappeTyme.cb.set(lc);
FappeTyme.cb.set(lc);
}
} }
return Post.callbacks.push({ return Post.callbacks.push({
name: 'Fappe Tyme', name: 'Fappe Tyme',
@ -9812,7 +9810,6 @@
}, },
cb: { cb: {
set: function(type) { set: function(type) {
FappeTyme[type].checked = Conf[type];
return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme"); return $["" + (Conf[type] ? 'add' : 'rm') + "Class"](doc, "" + type + "Tyme");
}, },
toggle: function() { toggle: function() {

View File

@ -4,7 +4,7 @@ FappeTyme =
for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"] for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"]
lc = type.toLowerCase() lc = type.toLowerCase()
el = $.el 'a', FappeTyme[lc] = el = $.el 'a',
href: 'javascript:;' href: 'javascript:;'
id: "#{lc}Tyme" id: "#{lc}Tyme"
title: "#{type} Tyme" title: "#{type} Tyme"
@ -16,7 +16,7 @@ FappeTyme =
$.on el, 'click', FappeTyme.cb.toggle.bind {name: "#{lc}"} $.on el, 'click', FappeTyme.cb.toggle.bind {name: "#{lc}"}
Header.addShortcut el, true Header.addShortcut el, true
FappeTyme.cb.set lc if Conf[lc] FappeTyme.cb.set lc
Post.callbacks.push Post.callbacks.push
name: 'Fappe Tyme' name: 'Fappe Tyme'
@ -27,9 +27,7 @@ FappeTyme =
$.addClass @nodes.root, "noFile" $.addClass @nodes.root, "noFile"
cb: cb:
set: (type) -> set: (type) -> $["#{if Conf[type] then 'add' else 'rm'}Class"] doc, "#{type}Tyme"
FappeTyme[type].checked = Conf[type]
$["#{if Conf[type] then 'add' else 'rm'}Class"] doc, "#{type}Tyme"
toggle: -> toggle: ->
Conf[@name] = !Conf[@name] Conf[@name] = !Conf[@name]