This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// utilizes the browser eventsystem | |
// usefull in cases where you need communication between independent components | |
// registered events are automatically removed onunload with preserving any other onunload handler | |
var eventsMixin = function(target) { | |
var _subscriptions = []; | |
target.broadcast = function(type, payload) { | |
var ev = new CustomEvent(type, { | |
detail: payload, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var m = require('mithril'); | |
var t = require('client/utils/translate'); | |
var vagueTime = require('vague-time'); | |
var l16n = require('client/utils/l16n'); | |
function assignValue(obj, objAttr) { | |
return function (event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default ( keyOrHash, handler ) => | |
function config( el, init, ctxt ){ | |
if( init ) return | |
const hash = handler ? { | |
[ keyOrHash ] : handler | |
} : keyOrHash | |
for( let key in hash ) | |
if( hash.hasOwnProperty( key ) ) |
OlderNewer