code: function(file1, file2) {
  		var self  = this,
  			type  = self.sortType,
  			asc   = self.sortOrder == 'asc',
  			stick = self.sortStickFolders,
  			rules = self.sortRules,
  			sort  = rules[type],
  			d1    = file1.mime == 'directory',
  			d2    = file2.mime == 'directory',
  			res;
  			
  		if (stick) {
  			if (d1 && !d2) {
  				return -1;
  			} else if (!d1 && d2) {
  				return 1;
  			}
  		}
  		
  		res = asc ? sort(file1, file2) : sort(file2, file1);
  		
  		return type !== 'name' && res === 0
  			? res = asc ? rules.name(file1, file2) : rules.name(file2, file1)
  			: res;
  	}
docs: Compare files based on elFinder.sort
  
  @param  Object  file
  @param  Object  file
  @return Number