Revision 8102,
1.0 KB
checked in by douglas, 11 years ago
(diff) |
Ticket #3600 - Problema ao listar pastas locais no Expresso Mail
|
Rev | Line | |
---|
[7738] | 1 | /**
|
---|
| 2 | * Created with JetBrains PhpStorm.
|
---|
| 3 | * User: Adriano
|
---|
| 4 | * Date: 12/01/13
|
---|
| 5 | * Time: 08:51
|
---|
| 6 | * To change this template use File | Settings | File Templates.
|
---|
| 7 | */
|
---|
| 8 | Folder = {
|
---|
| 9 |
|
---|
| 10 | allFolders : {},
|
---|
| 11 | bayKey: {},
|
---|
| 12 |
|
---|
| 13 | get: function( filter, force ){
|
---|
| 14 |
|
---|
| 15 | return ( ( filter === false ) ? Folder.getList( force ) : Folder.getFolder( filter, force ) )
|
---|
| 16 |
|
---|
| 17 | },
|
---|
| 18 |
|
---|
| 19 | getList: function( force ){
|
---|
| 20 |
|
---|
| 21 | if( force == true || $.isEmptyObject( Folder.allFolders ) ){
|
---|
| 22 |
|
---|
| 23 | Folder.refresh();
|
---|
| 24 |
|
---|
| 25 | }
|
---|
| 26 |
|
---|
[8102] | 27 | return $.extend([], Folder.allFolders);
|
---|
[7738] | 28 | },
|
---|
| 29 |
|
---|
| 30 | getFolder: function( filter, force ){
|
---|
| 31 |
|
---|
| 32 | if( force || !Folder.bayKey[ filter ] ){
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | Folder.bayKey[ filter ] = DataLayer.get('folder', filter, true);
|
---|
| 36 |
|
---|
| 37 | }
|
---|
| 38 |
|
---|
[8102] | 39 | return $.extend({}, Folder.bayKey[ filter ]);
|
---|
[7738] | 40 | },
|
---|
| 41 |
|
---|
| 42 | refresh: function(){
|
---|
| 43 | /*
|
---|
| 44 | * Get folders and not cached in Storage
|
---|
| 45 | * */
|
---|
| 46 | Folder.allFolders = DataLayer.get('folder', true);
|
---|
| 47 |
|
---|
| 48 | }
|
---|
[8102] | 49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.