Sha256: 546f5a7cc1e408f8d504be6b76a1acc612243dd50b6b21da16af202250559b81

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

// ==========================================================================
// Project:   Greenhouse.filesController
// Copyright: ©2009 My Company, Inc.
// ==========================================================================
/*globals Greenhouse */

/** @class


  @extends TreeController
*/
Greenhouse.filesController = SC.TreeController.create(SC.CollectionViewDelegate,
/** @scope Greenhouse.filesController.prototype */ {

  // ..........................................................
  // Drag and drop support
  // 
  collectionViewValidateDragOperation: function(view, drag, op, proposedInsertionIndex, proposedDropOperation) {
    return SC.DRAG_ANY;
  },

  collectionViewPerformDragOperation: function(view, drag, op, proposedInsertionIndex, proposedDropOperation) {
    console.log('delegate works');
    return SC.DRAG_NONE ;
  },


  treeItemChildrenKey: "contents",
  
  /**
    Call this method whenever you want to relaod the files from the server.
  */
  reload: function() {
    var fileQuery = Greenhouse.FILES_QUERY, target = Greenhouse.targetController.get('content');
    fileQuery.set('urlPath', target.get('name'));
    var files = Greenhouse.store.find(fileQuery), root = SC.Object.create({treeItemIsExpanded: YES});
    root.set('contents', files);
    this.set('content', root);
  }
}) ;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sproutcore-1.4.0.rc.5 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.4.0.rc.4 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.4.0.rc.3 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.4.0.rc.2 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.4.0.rc lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.0.1049.pre.2 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.0.1049.pre.1 frameworks/sproutcore/apps/greenhouse/controllers/files.js