1 /*
  2  * ***** BEGIN LICENSE BLOCK *****
  3  * Zimbra Collaboration Suite Web Client
  4  * Copyright (C) 2014, 2016 Synacor, Inc.
  5  *
  6  * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License");
  7  * you may not use this file except in compliance with the License.
  8  * You may obtain a copy of the License at: https://www.zimbra.com/license
  9  * The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15
 10  * have been added to cover use of software over a computer network and provide for limited attribution
 11  * for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
 12  *
 13  * Software distributed under the License is distributed on an "AS IS" basis,
 14  * WITHOUT WARRANTY OF ANY KIND, either express or implied.
 15  * See the License for the specific language governing rights and limitations under the License.
 16  * The Original Code is Zimbra Open Source Web Client.
 17  * The Initial Developer of the Original Code is Zimbra, Inc.  All rights to the Original Code were
 18  * transferred by Zimbra, Inc. to Synacor, Inc. on September 14, 2015.
 19  *
 20  * All portions of the code are Copyright (C) 2014, 2016 Synacor, Inc. All Rights Reserved.
 21  * ***** END LICENSE BLOCK *****
 22  */
 23 
 24 /**
 25  * @overview
 26  * This file contains the briefcase tree view class.
 27  *
 28  */
 29 
 30 /**
 31  * Creates the briefcase tree view.
 32  * @class
 33  * This class is a view for the tree view used by the briefcase application, supporting external DnD
 34  *
 35  * @param	params		params passed to create TreeView
 36  *
 37  * @author Vince Bellows
 38  *
 39  * @extends		ZmTreeView
 40  */
 41 ZmBriefcaseTreeView = function(params) {
 42 
 43 	ZmTreeView.call(this,  params);
 44 };
 45 
 46 ZmBriefcaseTreeView.prototype = new ZmTreeView;
 47 ZmBriefcaseTreeView.prototype.constructor = ZmBriefcaseTreeView;
 48 
 49 /**
 50  * Returns a string representation of the object.
 51  *
 52  * @return		{String}		a string representation of the object
 53  */
 54 ZmBriefcaseTreeView.prototype.toString = function() {
 55 	return "ZmBriefcaseTreeView";
 56 };
 57 
 58 ZmBriefcaseTreeView.prototype._submitMyComputerAttachments = function(files, node, isInline, ev) {
 59 	var el = ev.target;
 60 	var folderId;
 61 	if (el != null) {
 62 		// Walk up the parents and find one that has an associated folder id (if any)
 63 		while ((el != null) && !folderId) {
 64 			if (el.id) {
 65 				folderId = this._idToOrganizer[el.id];
 66 			}
 67 			el = el.parentNode;
 68 		}
 69 	}
 70 	if (folderId) {
 71 		var briefcaseApp = appCtxt.getApp(ZmApp.BRIEFCASE);
 72 		briefcaseApp.initExternalDndUpload(files, null, isInline, null, folderId);
 73 	}
 74 };
 75 
 76 
 77