Sha256: 1cd91a14728f92f00bd6f880aee41779d6a6640aa20781544932b55bcb4ca695

Contents?: true

Size: 971 Bytes

Versions: 4

Compression:

Stored size: 971 Bytes

Contents

dojo.provide("dojo.dnd.common");

dojo.dnd._isMac = navigator.appVersion.indexOf("Macintosh") >= 0;
dojo.dnd._copyKey = dojo.dnd._isMac ? "metaKey" : "ctrlKey";

dojo.dnd.getCopyKeyState = function(e) {
	// summary: abstracts away the difference between selection on Mac and PC,
	//	and returns the state of the "copy" key to be pressed.
	// e: Event: mouse event
	return e[dojo.dnd._copyKey];	// Boolean
};

dojo.dnd._uniqueId = 0;
dojo.dnd.getUniqueId = function(){
	// summary: returns a unique string for use with any DOM element
	var id;
	do{
		id = dojo._scopeName + "Unique" + (++dojo.dnd._uniqueId);
	}while(dojo.byId(id));
	return id;
};

dojo.dnd._empty = {};

dojo.dnd.isFormElement = function(/*Event*/ e){
	// summary: returns true, if user clicked on a form element
	var t = e.target;
	if(t.nodeType == 3 /*TEXT_NODE*/){
		t = t.parentNode;
	}
	return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0;	// Boolean
};

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dojo/dnd/common.js
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dojo/dnd/common.js
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dojo/dnd/common.js
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dojo/dnd/common.js