ax5ui-docker
"docker" dock panel UI
Dependencies
Install with bower
bower install ax5ui-docker
bower is web front-end package manager.
When you install bower
, it will be installed under the bower_components
folder to resolve the plug-in dependencies.
(You can change the folder location. .bowerrc )
It is recommended that you install by using bower
.
If you've never used bower, please refer to http://bower.io/#install-bower.
Install with npm
If you do not use bower, it also can be installed by using npm as an alternative.
In case of npm, which is the package manager for the front end, you need to solve the problem of plug-in dependencies.
npm install jquery
npm install ax5core
npm install ax5ui-menu
npm install ax5ui-docker
After downloading the install file of npm, you will need to copy it to the location where you want to use as a resource for the project.
If the copy process is inconvenient, it also can be done easily by using gulp
or grunt
.
Download code
Insert "ax5docker" in HTML HEAD.
Folder location can be any for your project. However, please be sure to assign the right path in the project.
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-menu/master/dist/ax5menu.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5core/master/dist/ax5core.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5menu/master/dist/ax5menu.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.min.js"></script>
CDN urls
This is a list of CDN urls for ax5ui-docker. ax5ui offers the CDN services through rawgit.
https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.css
https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.min.js
Basic Usage
<div data-ax5docker="docker1" style="height: 500px;background: #eee;padding: 5px;"></div>
$(function () {
var myDocker = new ax5.ui.docker();
myDocker.setConfig({
target: $('[data-ax5docker="docker1"]'),
icons: {
close: '<i class="fa fa-times" aria-hidden="true"></i>',
more: '<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>'
},
panels: [
{
type: "row",
panels: [
{
type: "column",
panels: [
{
type: "panel",
name: "my name 1",
moduleName: "content",
moduleState: {
data1: "data1"
}
},
{
type: "panel",
name: "my name 1",
moduleName: "content",
moduleState: {
data1: "data1"
}
}
]
},
{
type: "stack",
panels: [
{
type: "panel",
name: "my name 3",
moduleName: "content",
moduleState: {
data1: "data1"
}
}
]
}
]
}
],
disableClosePanel: false,
disableDragPanel: false,
control: {
before: function (that, callback) {
if (that.controlType === "destroy") {
if (confirm("Do you want to Delete?")) {
setTimeout(function () {
callback();
}, 300);
return;
}
} else {
callback();
return;
}
}
},
menu: {
theme: 'default',
position: "absolute",
icons: {
'arrow': '▸'
}
}
});
myDocker.onResize = function (e) {
console.log(e);
};
myDocker.addModule({
"content": {
init: function (container, state) {
container["$element"].html(JSON.stringify(state));
},
active: function (container, state) {
},
deactive: function (container, state) {
},
destroy: function (container, state) {
}
}
});
myDocker.repaint();
});
Preview
If you have any questions, please refer to the following gitHub
Question