How to use the do.js function in do

To help you get started, we’ve selected a few do examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zz85 / timeliner / src / ui_number.js View on Github external
cursor: 'ns-resize',
		width: '40px',
		margin: 0,
		marginRight: '10px',
		appearance: 'none',
		outline: 'none',
		border: 0,
		background: 'none',
		borderBottom: '1px dotted '+ Theme.c,
		color: Theme.c
	});

	var me = this;
	var state, value = 0, unchanged_value;

	this.onChange = new Do();

	span.addEventListener('change', function(e) {
		console.log('input changed', span.value);
		value = parseFloat(span.value, 10);

		fireChange();
	});

	handleDrag(span, onDown, onMove, onUp);

	function onUp(e) {
		if (e.moved) fireChange();
		else {
			// single click
			span.focus();
		}
github tengge1 / ShadowEditor / ShadowEditor.Web / assets / js / timeliner.js View on Github external
cursor: 'ns-resize',
				width: '40px',
				margin: 0,
				marginRight: '10px',
				appearance: 'none',
				outline: 'none',
				border: 0,
				background: 'none',
				borderBottom: '1px dotted ' + Theme.c,
				color: Theme.c
			});

			var me = this;
			var state, value = 0, unchanged_value;

			this.onChange = new Do();

			span.addEventListener('change', function (e) {
				console.log('input changed', span.value);
				value = parseFloat(span.value, 10);

				fireChange();
			});

			// Allow keydown presses in inputs, don't allow parent to block them
			span.addEventListener('keydown', function (e) {
				e.stopPropagation();
			})

			span.addEventListener('focus', function (e) {
				span.setSelectionRange(0, span.value.length);
			})
github tentone / nunuStudio / source / lib / timeliner.js View on Github external
scrolltrackHeight = h - 2;
		scrolltrack.style.height = scrolltrackHeight + 'px' ;
	};

	// Moves scrollbar to position by Percentage
	this.setPosition = function(p) {
		p = Math.max(Math.min(1, p), 0);
		var emptyTrack = scrolltrackHeight - bar_length;
		bar_y = p * emptyTrack;
		scrollbar.style.top = bar_y + 'px';
	};

	this.setLength(1);
	this.setPosition(0);
	this.onScroll = new SimpleEvent();

	var mouse_down_grip;

	function onDown(event) {
		event.preventDefault();

		if (event.target == scrollbar) {
			mouse_down_grip = event.clientY;
			document.addEventListener('mousemove', onMove, false);
			document.addEventListener('mouseup', onUp, false);
		} else {
			if (event.clientY < bar_y) {
				me.onScroll.fire('pageup');
			} else if (event.clientY > (bar_y + bar_length)) {
				me.onScroll.fire('pagedown');
			}
github tengge1 / ShadowEditor / ShadowEditor.Web / assets / js / timeliner.js View on Github external
scrolltrackHeight = h - 2;
				scrolltrack.style.height = scrolltrackHeight + 'px';
			};

			// Moves scrollbar to position by Percentage
			this.setPosition = function (p) {
				p = Math.max(Math.min(1, p), 0);
				var emptyTrack = scrolltrackHeight - bar_length;
				bar_y = p * emptyTrack;
				scrollbar.style.top = bar_y + 'px';
			};

			this.setLength(1);
			this.setPosition(0);
			this.onScroll = new SimpleEvent();

			var mouse_down_grip;

			function onDown(event) {
				event.preventDefault();

				if (event.target == scrollbar) {
					mouse_down_grip = event.clientY;
					document.addEventListener('mousemove', onMove, false);
					document.addEventListener('mouseup', onUp, false);
				} else {
					if (event.clientY < bar_y) {
						me.onScroll.fire('pageup');
					} else if (event.clientY > (bar_y + bar_length)) {
						me.onScroll.fire('pagedown');
					}
github zz85 / timeliner / timeliner.js View on Github external
scrolltrackHeight = h - 2;
		scrolltrack.style.height = scrolltrackHeight + 'px' ;
	};

	// Moves scrollbar to position by Percentage
	this.setPosition = function(p) {
		p = Math.max(Math.min(1, p), 0);
		var emptyTrack = scrolltrackHeight - bar_length;
		bar_y = p * emptyTrack;
		scrollbar.style.top = bar_y + 'px';
	};

	this.setLength(1);
	this.setPosition(0);
	this.onScroll = new SimpleEvent();

	var mouse_down_grip;

	function onDown(event) {
		event.preventDefault();

		if (event.target == scrollbar) {
			mouse_down_grip = event.clientY;
			document.addEventListener('mousemove', onMove, false);
			document.addEventListener('mouseup', onUp, false);
		} else {
			if (event.clientY < bar_y) {
				me.onScroll.fire('pageup');
			} else if (event.clientY > (bar_y + bar_length)) {
				me.onScroll.fire('pagedown');
			}
github tentone / nunuStudio / source / lib / timeliner.js View on Github external
function DataStore() {
	this.DELIMITER = ':';
	this.blank();
	this.onOpen = new Do();
	this.onSave = new Do();

	this.listeners = [];
}
github zz85 / timeliner / timeliner.js View on Github external
function DataStore() {
	this.DELIMITER = ':';
	this.blank();
	this.onOpen = new Do();
	this.onSave = new Do();

	this.listeners = [];
}
github tengge1 / ShadowEditor / ShadowEditor.Web / assets / js / timeliner.js View on Github external
function DataStore() {
			this.DELIMITER = ':';
			this.blank();
			this.onOpen = new Do();
			this.onSave = new Do();

			this.listeners = [];
		}
github zz85 / timeliner / src / util_datastore.js View on Github external
function DataStore() {
	this.DELIMITER = ':';
	this.blank();
	this.onOpen = new Do();
	this.onSave = new Do();

	this.listeners = [];
}
github zz85 / timeliner / timeliner.js View on Github external
function DataStore() {
	this.DELIMITER = ':';
	this.blank();
	this.onOpen = new Do();
	this.onSave = new Do();

	this.listeners = [];
}

do

The simplest way to manage asynchronicity

MIT
Latest version published 12 months ago

Package Health Score

59 / 100
Full package analysis