This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefault.js
More file actions
85 lines (85 loc) · 5.29 KB
/
default.js
File metadata and controls
85 lines (85 loc) · 5.29 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var ej2_react_navigations_1 = require("@syncfusion/ej2-react-navigations");
var ej2_react_buttons_1 = require("@syncfusion/ej2-react-buttons");
var sample_base_1 = require("../common/sample-base");
require("./sidebar-component.css");
var Default = (function (_super) {
__extends(Default, _super);
function Default() {
return _super !== null && _super.apply(this, arguments) || this;
}
Default.prototype.render = function () {
var _this = this;
return (React.createElement("div", { className: "control-section" },
React.createElement("div", { className: "col-lg-12 col-sm-12 col-md-12 center" }, "Click the button to view the sample"),
React.createElement("div", { className: "col-lg-12 col-sm-12 col-md-12 center" },
React.createElement("a", { className: "e-btn", id: "newTab", onClick: this.newTabClick.bind(this), target: "_blank" }, "Open in new Tab")),
React.createElement("div", { id: "wrapper" },
React.createElement("title", null, "Essential JS 2 for React- Sidebar > Default functionalities"),
React.createElement("div", { className: "col-lg-12 col-sm-12 col-md-12", id: "sidebar-section" },
React.createElement("span", { id: "hamburger", className: "e-icons menu default", onClick: this.openClick.bind(this) }),
React.createElement(ej2_react_navigations_1.SidebarComponent, { id: "default-sidebar", ref: function (Sidebar) { return _this.sidebarobj = Sidebar; } },
React.createElement("div", { className: "title-header" },
React.createElement("div", { style: { display: 'inline-block' } }, " Sidebar "),
React.createElement("span", { id: "close", className: "e-icons", onClick: this.closeClick.bind(this) })),
React.createElement("div", { className: "sub-title" }, "Place your primary content here.")),
React.createElement("div", null,
React.createElement("div", { className: "title default" }, "Main content"),
React.createElement("div", { className: "sub-title" },
" Click the button to open / close the sidebar.",
React.createElement("div", { className: "center-align" },
React.createElement(ej2_react_buttons_1.ButtonComponent, { onClick: this.toggleClick.bind(this), id: "toggle", className: "e-btn e-info" }, "Toggle Sidebar")),
React.createElement("p", null, "Click the radio button to switch the sidebar position"),
React.createElement("div", { className: "column" },
React.createElement(ej2_react_buttons_1.RadioButtonComponent, { id: "left", label: "Left", name: "state", checked: true, change: this.positionChange.bind(this) })),
React.createElement("div", { className: "column" },
React.createElement(ej2_react_buttons_1.RadioButtonComponent, { id: "right", label: "Right", name: "state", change: this.positionChange.bind(this) })))))),
React.createElement("div", { id: "action-description" },
React.createElement("p", null, "Click the button to view the Sidebar sample in new tab.")),
React.createElement("div", { id: "description" },
React.createElement("p", null,
"This sample demonstrates the basic ",
React.createElement("code", null, "Sidebar"),
" component. Click the toggle button to expand or collapse the sidebar."))));
};
//open new Tab
Default.prototype.newTabClick = function () {
document.getElementById('newTab').setAttribute('href', location.href.split('#')[0] + 'sidebar/default/index.html');
};
// change the Sidebar position
Default.prototype.positionChange = function (args) {
this.sidebarobj.position = args.event.target.id == "left" ? "Left" : "Right";
if (args.event.target.id === "right") {
document.getElementById('hamburger').className += " e-rtl";
}
if (args.event.target.id === "left") {
document.getElementById('hamburger').classList.remove("e-rtl");
}
};
//open / close the sidebar
Default.prototype.toggleClick = function () {
this.sidebarobj.toggle();
};
//close the sidebar
Default.prototype.closeClick = function () {
this.sidebarobj.hide();
};
//open the sidebar
Default.prototype.openClick = function () {
this.sidebarobj.show();
};
return Default;
}(sample_base_1.SampleBase));
exports.Default = Default;