Sha256: e9c4fbcdb8282d98327ecea1b379049bc404080cf50f0697d428157f0b978f63

Contents?: true

Size: 1.29 KB

Versions: 42

Compression:

Stored size: 1.29 KB

Contents

// ==========================================================================
// Project:   Greenhouse.filesController
// Copyright: ©2010 Mike Ball
// ==========================================================================
/*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

42 entries across 42 versions & 2 rubygems

Version Path
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.3-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.3 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.2-java lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.2 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js
sproutcore-1.6.0.beta.1 lib/frameworks/sproutcore/frameworks/experimental/apps/greenhouse/controllers/files.js