-
Notifications
You must be signed in to change notification settings - Fork 44
/
dnsRecords.main.js
51 lines (45 loc) · 1.63 KB
/
dnsRecords.main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/
var configDNSRecordsLoader = new ConfigDNSRecordsLoader();
function ConfigDNSRecordsLoader() {
this.load = function(paramObject) {
var self = this,
currMenuObj = globalObj.currMenuObj,
hashParams = paramObject['hashParams'],
rootDir = currMenuObj['resources']['resource'][1]['rootDir'],
pathDNSRecordsView = ctBaseDir + '/config/dns/records/ui/js/views/dnsRecordsView.js',
renderFn = paramObject['function'],
loadingStartedDefObj = paramObject['loadingStartedDefObj'];
$(contentContainer).empty();
if (self.dnsRecordsView == null) {
requirejs([pathDNSRecordsView], function(DnsRecordsView) {
self.dnsRecordsView = new DnsRecordsView();
self.renderView(renderFn, hashParams);
if(contrail.checkIfExist(loadingStartedDefObj)) {
loadingStartedDefObj.resolve();
}
});
} else {
self.renderView(renderFn, hashParams);
}
};
this.renderView = function(renderFn, hashParams) {
$(contentContainer).html("");
switch (renderFn) {
case 'renderDnsRecords':
this.dnsRecordsView[renderFn]({
hashParams: hashParams
});
break;
}
};
this.updateViewByHash = function(hashObj, lastHashObj) {
var renderFn;
this.load({
hashParams: hashObj,
'function': renderFn
});
};
this.destroy = function() {};
}