Pman.Dialog.LoginNotice.bjs
[Pman.BAdmin] / Pman.Dialog.LoginNotice.bjs
1 {
2  "name" : "Pman.Dialog.LoginNotice",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.BAdmin/Pman.Dialog.LoginNotice.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "c4408d335012a56ff58937d78050efad" : "Accept",
10   "d41d8cd98f00b204e9800998ecf8427e" : ""
11  },
12  "items" : [
13   {
14    "listeners" : {
15     "show" : "function (_self)\n{\n    _this.dialog.footerEl.setVisibilityMode(Roo.Element.DISPLAY).hide();\n    \n    if(_this.data.title){\n        _this.dialog.titleEl.dom.innerHTML = _this.data.title;\n    }\n    \n    if(_this.data.buttonText){\n        _this.acceptBtn.setText(_this.data.buttonText);\n    }\n    \n    if(_this.data.chunk){\n        \n        Roo.Ajax.request({\n            url : baseURL + '/Roo/TermsRender/' + _this.data.chunk,\n            method : 'GET',\n            success : function(res) {\n            \n                _this.terms_body.el.dom.innerHTML = res.responseText;\n                \n                _this.dialog.init();\n            }\n        });\n        \n    }\n    \n    if(_this.data.declaration){\n        \n        Roo.Ajax.request({\n            url : baseURL + '/Roo/DeclarationsRender/' + _this.data.declaration,\n            method : 'GET',\n            success : function(res) {\n            \n                _this.terms_body.el.dom.innerHTML = res.responseText;\n                \n                _this.dialog.init();\n            }\n        });\n        \n    }\n    \n    _this.dialog.el.setStyle('zIndex', '10002');\n    \n}"
16    },
17    "String cls" : "enable-overflow",
18    "String size" : "lg",
19    "| function onScroll" : "function() \n{ \n    var scrollHeight = _this.terms_body.el.dom.scrollHeight;\n    \n    var scrollTop = Math.ceil(_this.terms_body.el.getScroll().top); // prevent zoom browser\n    \n    if(scrollHeight - 380 > scrollTop){\n        return;\n    }\n    \n    _this.acceptBtn.enableIt();\n    \n}",
20    "xtype" : "Modal",
21    "$ xns" : "Roo.bootstrap",
22    "| function init" : "function() \n{ \n    _this.terms_body.el.scrollTo('top');\n    \n    _this.acceptBtn.enableIt();\n    \n    if(typeof(_this.data.disableScrolling) != 'undefined' && _this.data.disableScrolling == 1){\n        return;\n    }\n    \n    var scrollHeight = _this.terms_body.el.dom.scrollHeight;\n    \n    if(scrollHeight <= 380){\n        return;\n    }\n    \n    _this.acceptBtn.disableIt();\n    \n    _this.terms_body.el.on('scroll', this.onScroll, this);\n}",
23    "String title" : "",
24    "items" : [
25     {
26      "xtype" : "Row",
27      "$ xns" : "Roo.bootstrap",
28      "items" : [
29       {
30        "listeners" : {
31         "render" : "function (_self)\n{\n    _this.terms_body = this;\n}"
32        },
33        "Number md" : 12,
34        "xtype" : "Column",
35        "$ xns" : "Roo.bootstrap",
36        "String style" : "max-height: 380px; overflow-y: auto;"
37       },
38       {
39        "Number md" : 12,
40        "String cls" : "text-right",
41        "xtype" : "Column",
42        "$ xns" : "Roo.bootstrap",
43        "String style" : "margin-top: 15px;",
44        "items" : [
45         {
46          "listeners" : {
47           "render" : "function (_self)\n{\n    _this.acceptBtn = this;\n    \n}",
48           "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n\n    if(_this.callback){\n        _this.callback.call(_this);\n    }\n    \n}"
49          },
50          "| function disableIt" : "function() \n{ \n    this.setText('Scroll to end before agree');\n    this.disable();\n}",
51          "String cls" : "coba-agree-btn",
52          "String weight" : "primary",
53          "xtype" : "Button",
54          "$ xns" : "Roo.bootstrap",
55          "String html" : "Accept",
56          "| function enableIt" : "function() \n{ \n    this.setText('Agree');\n    \n    if(_this.data.buttonText){\n        this.setText(_this.data.buttonText);\n    }\n    \n    this.enable();\n}"
57         }
58        ]
59       }
60      ]
61     }
62    ]
63   }
64  ]
65 }