Sha256: 529da454be83e1ae95eb16606cdf652705703d624ba5aecccc2c651bff16eb70

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

// ==========================================================================
// Project:   Greenhouse.filesController
// Copyright: ©2010 Mike Ball
// ==========================================================================
/*globals Greenhouse */

/**


  @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 reload 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

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.2 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.1 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.0 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/apps/greenhouse/controllers/files.js