Path: blob/trunk/third_party/closure/goog/fx/dragdrop.js
2868 views
// Copyright 2006 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview Single Element Drag and Drop.16*17* Drag and drop implementation for sources/targets consisting of a single18* element.19*20* @author [email protected] (Emil A Eklund)21* @see ../demos/dragdrop.html22*/2324goog.provide('goog.fx.DragDrop');2526goog.require('goog.fx.AbstractDragDrop');27goog.require('goog.fx.DragDropItem');28293031/**32* Drag/drop implementation for creating drag sources/drop targets consisting of33* a single HTML Element.34*35* @param {Element|string} element Dom Node, or string representation of node36* id, to be used as drag source/drop target.37* @param {Object=} opt_data Data associated with the source/target.38* @throws Error If no element argument is provided or if the type is invalid39* @extends {goog.fx.AbstractDragDrop}40* @constructor41* @struct42*/43goog.fx.DragDrop = function(element, opt_data) {44goog.fx.AbstractDragDrop.call(this);4546var item = new goog.fx.DragDropItem(element, opt_data);47item.setParent(this);48this.items_.push(item);49};50goog.inherits(goog.fx.DragDrop, goog.fx.AbstractDragDrop);515253