Átállás
JUSTWEB létrehozása
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<ApplicationTitle>Nuvolar Mobile Scanner</ApplicationTitle>
|
||||
<VersionPackage>1.0.1.350</VersionPackage>
|
||||
<ShowSplashScreen>True</ShowSplashScreen>
|
||||
<UpgradeNotifyShown>16.2.3</UpgradeNotifyShown>
|
||||
<UpgradeNotifyShown>17.1.5</UpgradeNotifyShown>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
// NOTE object below must be a valid JSON
|
||||
window.Nuvolar_Scanner_Android = $.extend(true, window.Nuvolar_Scanner_Android, {
|
||||
"config": {
|
||||
"config": {
|
||||
"layoutSet": "slideout",
|
||||
"animationSet": "default",
|
||||
"commandMapping": {
|
||||
"ios-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "sde",
|
||||
"location": "after"
|
||||
},
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"generic-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "ghz",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"android-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"win10-phone-appbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "menu"
|
||||
}
|
||||
]
|
||||
},
|
||||
"android-simple-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
}
|
||||
"ios-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "sde",
|
||||
"location": "after"
|
||||
},
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"generic-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "ghz",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"android-header-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
},
|
||||
"win10-phone-appbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"locateInMenu": "always"
|
||||
}
|
||||
]
|
||||
},
|
||||
"android-simple-toolbar": {
|
||||
"commands": [
|
||||
{
|
||||
"id": "delete",
|
||||
"location": "after"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<preference name="StatusBarOverlaysWebView" value="false" />
|
||||
<preference name="StatusBarBackgroundColor" value="#000000" />
|
||||
<feature name="http://api.phonegap.com/1.0/network" />
|
||||
<gap:plugin name="com.devexpress.plugins.devextremeaddon" version="1.0.1" />
|
||||
<gap:plugin name="cordova-plugin-statusbar" version="2.1.0" source="npm" onload="true" />
|
||||
<gap:plugin name="org.apache.cordova.battery-status" version="0.2.12" />
|
||||
<gap:plugin name="org.apache.cordova.camera" version="0.3.6" />
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
.empty-layout {
|
||||
.empty-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
@@ -16,4 +16,4 @@
|
||||
.empty-layout > div.content > div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="empty-layout" data-options="dxLayout : { name: 'empty' } " >
|
||||
<div class="empty-layout" data-options="dxLayout : { name: 'empty' } " >
|
||||
<div class="content layout-content" data-options="dxContentPlaceholder : { name: 'content', animation: 'view-content-change' }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,23 +1,42 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController)
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.EmptyLayout = factory(jQuery, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController);
|
||||
root.DevExpress.framework.html.EmptyLayoutController = root.DevExpress.layouts.EmptyLayout.EmptyLayoutController
|
||||
root.DevExpress.layouts.EmptyLayout = factory(
|
||||
jQuery,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController
|
||||
);
|
||||
root.DevExpress.framework.html.EmptyLayoutController = root.DevExpress.layouts.EmptyLayout.EmptyLayoutController;
|
||||
}
|
||||
}(this, function($, layoutSets, DefaultLayoutController) {
|
||||
}(window, function($, layoutSets, DefaultLayoutController) {
|
||||
|
||||
var exports = {};
|
||||
var EmptyLayoutController = DefaultLayoutController.inherit({ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "empty";
|
||||
this.callBase(options)
|
||||
}});
|
||||
|
||||
var EmptyLayoutController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "empty";
|
||||
this.callBase(options);
|
||||
}
|
||||
});
|
||||
|
||||
layoutSets["empty"] = layoutSets["empty"] || [];
|
||||
layoutSets["empty"].push({controller: new EmptyLayoutController});
|
||||
layoutSets["empty"].push({
|
||||
controller: new EmptyLayoutController()
|
||||
});
|
||||
|
||||
exports.EmptyLayoutController = EmptyLayoutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Layout */
|
||||
/* Layout */
|
||||
|
||||
.navbar-layout,
|
||||
.navbar-layout-tablet {
|
||||
@@ -94,13 +94,16 @@
|
||||
}
|
||||
|
||||
.dx-theme-android5 .navbar-layout .layout-footer {
|
||||
bottom: 0;
|
||||
height: 56px;
|
||||
display: none;
|
||||
bottom: -9999px;
|
||||
left: -9999px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.dx-theme-android5 .navbar-layout.has-toolbar .layout-footer {
|
||||
display: block;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* win8 */
|
||||
@@ -251,7 +254,7 @@
|
||||
bottom: 68px;
|
||||
}
|
||||
|
||||
.dx-theme-generic .navbar-layout .layout-footer,
|
||||
.dx-theme-generic .navbar-layout .layout-footer,
|
||||
.dx-theme-generic .navbar-layout .layout-footer .dx-navbar {
|
||||
bottom: 0;
|
||||
height: 68px;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="navbar-layout" data-options="dxLayout : { name: 'navbar', platform: 'ios' } ">
|
||||
<div class="navbar-layout" data-options="dxLayout : { name: 'navbar', platform: 'ios' } ">
|
||||
<div class="layout-header dx-toolbar-background" data-options="dxContentPlaceholder : { name: 'header', animation: 'view-header-toolbar' }">
|
||||
<div data-bind="dxToolbar: { items: [ { text: title, location: 'center' } ] }" data-options="dxCommandContainer : { id: 'ios-header-toolbar' }">
|
||||
</div>
|
||||
|
||||
@@ -1,63 +1,99 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("ui/toolbar"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
|
||||
require("ui/toolbar")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.NavbarLayout = factory(DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController);
|
||||
root.DevExpress.framework.html.NavBarController = root.DevExpress.layouts.NavbarLayout.NavBarController
|
||||
root.DevExpress.layouts.NavbarLayout = factory(
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController
|
||||
);
|
||||
root.DevExpress.framework.html.NavBarController = root.DevExpress.layouts.NavbarLayout.NavBarController;
|
||||
}
|
||||
}(this, function(layoutSets, DefaultLayoutController) {
|
||||
}(window, function(layoutSets, DefaultLayoutController) {
|
||||
|
||||
var exports = {},
|
||||
HAS_NAVBAR_CLASS = "has-navbar",
|
||||
HAS_TOOLBAR_CLASS = "has-toolbar",
|
||||
|
||||
LAYOUT_FOOTER_SELECTOR = ".layout-footer",
|
||||
ACTIVE_TOOLBAR_SELECTOR = ".dx-active-view .dx-toolbar";
|
||||
|
||||
var NavBarController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "navbar";
|
||||
this.callBase(options)
|
||||
}, _createNavigationWidget: function(navigationCommands) {
|
||||
this.callBase(navigationCommands);
|
||||
this.$navbar = this._$mainLayout.find(".navbar-container");
|
||||
return this.$navbar
|
||||
}, _renderNavigationImpl: function(navigationCommands) {
|
||||
this.callBase(navigationCommands);
|
||||
if (navigationCommands.length) {
|
||||
this._$mainLayout.addClass(HAS_NAVBAR_CLASS)
|
||||
}
|
||||
}, _showViewImpl: function(viewInfo) {
|
||||
var that = this;
|
||||
return that.callBase.apply(that, arguments).done(function() {
|
||||
var $toolbar = that._$mainLayout.find(LAYOUT_FOOTER_SELECTOR).find(ACTIVE_TOOLBAR_SELECTOR),
|
||||
isToolbarEmpty = !$toolbar.length || !$toolbar.dxToolbar("instance").option("visible");
|
||||
that._$mainLayout.toggleClass(HAS_TOOLBAR_CLASS, !isToolbarEmpty)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "navbar";
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
_createNavigationWidget: function(navigationCommands) {
|
||||
this.callBase(navigationCommands);
|
||||
this.$navbar = this._$mainLayout.find(".navbar-container");
|
||||
return this.$navbar;
|
||||
},
|
||||
|
||||
_renderNavigationImpl: function(navigationCommands) {
|
||||
this.callBase(navigationCommands);
|
||||
if (navigationCommands.length) {
|
||||
this._$mainLayout.addClass(HAS_NAVBAR_CLASS);
|
||||
}
|
||||
},
|
||||
|
||||
_showViewImpl: function(viewInfo) {
|
||||
var that = this;
|
||||
|
||||
return that.callBase.apply(that, arguments).done(function() {
|
||||
var $toolbar = that._$mainLayout.find(LAYOUT_FOOTER_SELECTOR).find(ACTIVE_TOOLBAR_SELECTOR),
|
||||
isToolbarEmpty = !$toolbar.length || !$toolbar.dxToolbar("instance").option("visible");
|
||||
|
||||
that._$mainLayout.toggleClass(HAS_TOOLBAR_CLASS, !isToolbarEmpty);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
layoutSets["navbar"] = layoutSets["navbar"] || [];
|
||||
layoutSets["navbar"].push({
|
||||
platform: "ios", controller: new NavBarController
|
||||
platform: "ios",
|
||||
controller: new NavBarController()
|
||||
});
|
||||
layoutSets["navbar"].push({
|
||||
platform: "android", controller: new NavBarController
|
||||
platform: "android",
|
||||
controller: new NavBarController()
|
||||
});
|
||||
layoutSets["navbar"].push({
|
||||
platform: "generic", controller: new NavBarController
|
||||
platform: "generic",
|
||||
controller: new NavBarController()
|
||||
});
|
||||
layoutSets["navbar"].push({
|
||||
platform: "win", controller: new NavBarController
|
||||
platform: "win",
|
||||
controller: new NavBarController()
|
||||
});
|
||||
|
||||
layoutSets["split"] = layoutSets["split"] || [];
|
||||
layoutSets["split"].push({
|
||||
platform: "win", phone: false, root: true, pane: "master", controller: new NavBarController
|
||||
platform: "win",
|
||||
phone: false,
|
||||
root: true,
|
||||
pane: "master",
|
||||
controller: new NavBarController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "win", phone: true, controller: new NavBarController
|
||||
platform: "win",
|
||||
phone: true,
|
||||
controller: new NavBarController()
|
||||
});
|
||||
|
||||
exports.NavBarController = NavBarController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Layout */
|
||||
/* Layout */
|
||||
|
||||
.navbar-layout-phone .layout-content,
|
||||
.navbar-layout-phone .layout-content > div {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="navbar-layout-phone" data-options="dxLayout : { name: 'pivot', platform: 'win', phone: true }">
|
||||
<div class="navbar-layout-phone" data-options="dxLayout : { name: 'pivot', platform: 'win', phone: true }">
|
||||
|
||||
<div class="layout-content" data-options="dxContentPlaceholder : { name: 'content' }">
|
||||
</div>
|
||||
|
||||
@@ -1,90 +1,153 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("ui/pivot"), require("ui/toolbar"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
|
||||
require("ui/pivot"),
|
||||
require("ui/toolbar")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.PivotLayout = factory(jQuery, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController);
|
||||
root.DevExpress.framework.html.PivotLayoutController = root.DevExpress.layouts.PivotLayout.PivotLayoutController
|
||||
root.DevExpress.layouts.PivotLayout = factory(
|
||||
jQuery,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController
|
||||
);
|
||||
root.DevExpress.framework.html.PivotLayoutController = root.DevExpress.layouts.PivotLayout.PivotLayoutController;
|
||||
}
|
||||
}(this, function($, layoutSets, DefaultLayoutController) {
|
||||
}(window, function($, layoutSets, DefaultLayoutController) {
|
||||
|
||||
var exports = {},
|
||||
HAS_TOOLBAR_BOTTOM_CLASS = "has-toolbar-bottom",
|
||||
TOOLBAR_BOTTOM_SELECTOR = ".layout-toolbar-bottom",
|
||||
ACTIVE_PIVOT_ITEM_SELECTOR = ".dx-pivot-item:not(.dx-pivot-item-hidden)";
|
||||
|
||||
var PivotLayoutController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "pivot";
|
||||
this._viewsInLayout = {};
|
||||
this.callBase(options)
|
||||
}, init: function(options) {
|
||||
this.callBase(options)
|
||||
}, _createNavigationWidget: function() {
|
||||
var that = this;
|
||||
this.$root = $("<div/>").addClass("pivot-layout");
|
||||
this.$pivot = $("<div/>").appendTo(this.$root).dxPivot({itemTemplate: function(itemData, itemIndex, itemElement) {
|
||||
var emptyLayout = that._createEmptyLayout();
|
||||
that._showElements(emptyLayout);
|
||||
emptyLayout.find(".layout-footer").remove();
|
||||
emptyLayout.appendTo(itemElement)
|
||||
}}).dxCommandContainer({id: 'global-navigation'});
|
||||
this.$pivot.dxPivot("instance").on("optionChanged", function(args) {
|
||||
if (args.name === "items") {
|
||||
that._clearPivotViewsRenderCache()
|
||||
}
|
||||
});
|
||||
var $tmpLayoutForFooter = that._createEmptyLayout();
|
||||
this._showElements($tmpLayoutForFooter);
|
||||
this.$footer = $tmpLayoutForFooter.find(".layout-footer").insertAfter(this.$pivot);
|
||||
return this.$pivot
|
||||
}, _clearPivotViewsRenderCache: function() {
|
||||
var that = this;
|
||||
$.each(this._viewsInLayout, function(key, viewInfo) {
|
||||
that._clearRenderResult(viewInfo)
|
||||
})
|
||||
}, _renderNavigationImpl: function(navigationCommands) {
|
||||
var container = this.$pivot.dxCommandContainer("instance");
|
||||
this._commandManager.renderCommandsToContainers(navigationCommands, [container])
|
||||
}, element: function() {
|
||||
return this.$root
|
||||
}, _getViewFrame: function(viewInfo) {
|
||||
var $result = this.$pivot.find(ACTIVE_PIVOT_ITEM_SELECTOR);
|
||||
$result = $result.add(this.$footer);
|
||||
return $result
|
||||
}, _showViewImpl: function(viewInfo, direction, previousViewTemplateId) {
|
||||
this._showViewElements(viewInfo.renderResult.$markup);
|
||||
this._changeView(viewInfo, previousViewTemplateId);
|
||||
this._changeAppbar();
|
||||
this._viewsInLayout[viewInfo.key] = viewInfo;
|
||||
return $.Deferred().resolve().promise()
|
||||
}, _changeAppbar: function() {
|
||||
var $appbar = this.$footer.find(".dx-active-view " + TOOLBAR_BOTTOM_SELECTOR),
|
||||
appbar = $appbar.dxToolbar("instance");
|
||||
if (appbar) {
|
||||
this._refreshAppbarVisibility(appbar, this.$root)
|
||||
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "pivot";
|
||||
this._viewsInLayout = {};
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
_createNavigationWidget: function() {
|
||||
var that = this;
|
||||
|
||||
this.$root = $("<div/>")
|
||||
.addClass("pivot-layout");
|
||||
|
||||
this.$pivot = $("<div/>")
|
||||
.appendTo(this.$root)
|
||||
.dxPivot({
|
||||
itemTemplate: function(itemData, itemIndex, itemElement) {
|
||||
var emptyLayout = that._createEmptyLayout();
|
||||
that._showElements(emptyLayout);
|
||||
emptyLayout.find(".layout-footer").remove();
|
||||
emptyLayout.appendTo(itemElement);
|
||||
}
|
||||
}, _refreshAppbarVisibility: function(appbar, $container) {
|
||||
var isAppbarNotEmpty = false;
|
||||
$.each(appbar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppbarNotEmpty = true;
|
||||
return false
|
||||
}
|
||||
});
|
||||
$container.toggleClass(HAS_TOOLBAR_BOTTOM_CLASS, isAppbarNotEmpty);
|
||||
appbar.option("visible", isAppbarNotEmpty)
|
||||
}, _hideView: function(viewInfo) {
|
||||
this.callBase.apply(this, arguments);
|
||||
this._changeAppbar()
|
||||
})
|
||||
.dxCommandContainer({
|
||||
id: 'global-navigation'
|
||||
});
|
||||
|
||||
this.$pivot.dxPivot("instance").on("optionChanged", function(args) {
|
||||
if (args.name === "items") {
|
||||
//Layouts design is not supposed to be able to remove a rendered view from a layout and insert it again.
|
||||
//Since the dxPivot widget doesn't support changing its items dynamically,
|
||||
//the items are recreated and view render cache should be cleared
|
||||
that._clearPivotViewsRenderCache();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var $tmpLayoutForFooter = that._createEmptyLayout();
|
||||
this._showElements($tmpLayoutForFooter);
|
||||
this.$footer = $tmpLayoutForFooter.find(".layout-footer").insertAfter(this.$pivot);
|
||||
|
||||
return this.$pivot;
|
||||
},
|
||||
|
||||
_clearPivotViewsRenderCache: function() {
|
||||
var that = this;
|
||||
|
||||
$.each(this._viewsInLayout, function(key, viewInfo) {
|
||||
that._clearRenderResult(viewInfo);
|
||||
});
|
||||
},
|
||||
|
||||
_renderNavigationImpl: function(navigationCommands) {
|
||||
var container = this.$pivot.dxCommandContainer("instance");
|
||||
this._commandManager.renderCommandsToContainers(navigationCommands, [container]);
|
||||
},
|
||||
|
||||
element: function() {
|
||||
return this.$root;
|
||||
},
|
||||
|
||||
_getViewFrame: function(viewInfo) {
|
||||
var $result = this.$pivot.find(ACTIVE_PIVOT_ITEM_SELECTOR);
|
||||
$result = $result.add(this.$footer);
|
||||
return $result;
|
||||
},
|
||||
|
||||
_showViewImpl: function(viewInfo, direction, previousViewTemplateId) {
|
||||
this._showViewElements(viewInfo.renderResult.$markup);
|
||||
this._changeView(viewInfo, previousViewTemplateId);
|
||||
this._changeAppBar();
|
||||
this._viewsInLayout[viewInfo.key] = viewInfo;
|
||||
return $.Deferred().resolve().promise();
|
||||
},
|
||||
|
||||
_changeAppBar: function() {
|
||||
var $appBar = this.$footer.find(".dx-active-view " + TOOLBAR_BOTTOM_SELECTOR),
|
||||
appBar = $appBar.dxToolbar("instance");
|
||||
|
||||
if (appBar) {
|
||||
this._refreshAppBarVisibility(appBar, this.$root);
|
||||
}
|
||||
},
|
||||
|
||||
_refreshAppBarVisibility: function(appBar, $container) {
|
||||
var isAppBarNotEmpty = false;
|
||||
|
||||
$.each(appBar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppBarNotEmpty = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$container.toggleClass(HAS_TOOLBAR_BOTTOM_CLASS, isAppBarNotEmpty);
|
||||
appBar.option("visible", isAppBarNotEmpty);
|
||||
},
|
||||
|
||||
_hideView: function(viewInfo) {
|
||||
this.callBase.apply(this, arguments);
|
||||
this._changeAppBar();
|
||||
}
|
||||
});
|
||||
|
||||
layoutSets["navbar"] = layoutSets["navbar"] || [];
|
||||
layoutSets["navbar"].push({
|
||||
platform: "win", version: [8], phone: true, root: true, controller: new PivotLayoutController
|
||||
platform: "win",
|
||||
version: [8],
|
||||
phone: true,
|
||||
root: true,
|
||||
controller: new PivotLayoutController()
|
||||
});
|
||||
|
||||
exports.PivotLayoutController = PivotLayoutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
.child-controller-content {
|
||||
.child-controller-content {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="popup-layout" data-options="dxLayout : { name: 'popup' }">
|
||||
<div class="popup-layout" data-options="dxLayout : { name: 'popup' }">
|
||||
<div data-bind="dxPopup: { showTitle: false, contentTemplate: 'content', fullScreen: true, deferRendering: false, closeOnBackButton: false, showCloseButton: false }" class="popup-container">
|
||||
<div data-options="dxTemplate: { name: 'content' }" class="child-controller-content">
|
||||
</div>
|
||||
|
||||
@@ -1,99 +1,152 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("../Simple/SimpleLayout.js").SimpleLayoutController, require("ui/popup"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
require("../Simple/SimpleLayout.js").SimpleLayoutController,
|
||||
|
||||
require("ui/popup")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.PopupLayout = factory(jQuery, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController, DevExpress.layouts.SimpleLayout.SimpleLayoutController);
|
||||
root.DevExpress.layouts.PopupLayout = factory(
|
||||
jQuery,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController,
|
||||
DevExpress.layouts.SimpleLayout.SimpleLayoutController
|
||||
);
|
||||
root.DevExpress.framework.html.OverlayLayoutControllerBase = root.DevExpress.layouts.PopupLayout.OverlayLayoutControllerBase;
|
||||
root.DevExpress.framework.html.PopupLayoutController = root.DevExpress.layouts.PopupLayout.PopupLayoutController
|
||||
root.DevExpress.framework.html.PopupLayoutController = root.DevExpress.layouts.PopupLayout.PopupLayoutController;
|
||||
}
|
||||
}(this, function($, layoutSets, DefaultLayoutController, SimpleLayoutController) {
|
||||
}(window, function($, layoutSets, DefaultLayoutController, SimpleLayoutController) {
|
||||
|
||||
var exports = {},
|
||||
abstract = DefaultLayoutController.abstract;
|
||||
|
||||
var OverlayLayoutControllerBase = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
if (!options.childController) {
|
||||
this._ensureChildController(SimpleLayoutController, "SimpleLayout");
|
||||
this.childController = new SimpleLayoutController
|
||||
}
|
||||
else {
|
||||
this.childController = options.childController
|
||||
}
|
||||
this.contentContainerSelector = options.contentContainerSelector
|
||||
}, _initChildController: function(options) {
|
||||
var that = this,
|
||||
$targetViewPort = that._$mainLayout.find(this.contentContainerSelector);
|
||||
that.childController.init($.extend({}, options, {$viewPort: $targetViewPort}));
|
||||
$.each(["viewRendered", "viewShowing", "viewReleased", "viewHidden"], function(_, callbacksPropertyName) {
|
||||
that.childController.on(callbacksPropertyName, function(args) {
|
||||
that.fireEvent(callbacksPropertyName, [args])
|
||||
})
|
||||
})
|
||||
}, _ensureChildController: function(controller, layoutName) {
|
||||
if (!controller) {
|
||||
throw new Error(layoutName + "Controller is not found but it is required by the '" + this.name + "' layout for specified platform and device. Make sure the " + layoutName + ".* files are referenced in your main *.html file or specify other platform and device.");
|
||||
}
|
||||
}, _base: function() {
|
||||
return DefaultLayoutController.prototype
|
||||
}, _showContainerWidget: abstract, _hideContainerWidget: abstract, init: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
this._initChildController(options)
|
||||
}, activate: function($target) {
|
||||
var that = this,
|
||||
result;
|
||||
that.childController.activate();
|
||||
that._base().activate.call(that, $target);
|
||||
result = that._showContainerWidget($target);
|
||||
return result
|
||||
}, deactivate: function() {
|
||||
var that = this,
|
||||
result;
|
||||
result = that._hideContainerWidget();
|
||||
result.done(function() {
|
||||
that._base().deactivate.call(that);
|
||||
that.childController.deactivate()
|
||||
});
|
||||
return result
|
||||
}, showView: function(viewInfo, direction) {
|
||||
return this.childController.showView(viewInfo, direction)
|
||||
}
|
||||
});
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
if (!options.childController) {
|
||||
|
||||
this.childController = new SimpleLayoutController();
|
||||
} else {
|
||||
this.childController = options.childController;
|
||||
}
|
||||
this.contentContainerSelector = options.contentContainerSelector;
|
||||
},
|
||||
|
||||
_initChildController: function(options) {
|
||||
var that = this,
|
||||
$targetViewPort = that._$mainLayout.find(this.contentContainerSelector);
|
||||
|
||||
that.childController.init($.extend({}, options, {
|
||||
$viewPort: $targetViewPort
|
||||
}));
|
||||
|
||||
$.each(["viewRendered", "viewShowing", "viewReleased", "viewHidden"], function(_, callbacksPropertyName) {
|
||||
that.childController.on(callbacksPropertyName, function(args) {
|
||||
that.fireEvent(callbacksPropertyName, [args]);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_ensureChildController: function(controller, layoutName) {
|
||||
if (!controller) {
|
||||
throw new Error(layoutName + "Controller is not found but it is required by the '" + this.name + "' layout for specified platform and device. Make sure the " + layoutName + ".* files are referenced in your main *.html file or specify other platform and device.");
|
||||
}
|
||||
},
|
||||
|
||||
_base: function() {
|
||||
return DefaultLayoutController.prototype;
|
||||
},
|
||||
|
||||
_showContainerWidget: abstract,
|
||||
|
||||
_hideContainerWidget: abstract,
|
||||
|
||||
init: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
this._initChildController(options);
|
||||
},
|
||||
|
||||
activate: function($target) {
|
||||
var that = this,
|
||||
result;
|
||||
|
||||
that.childController.activate();
|
||||
that._base().activate.call(that, $target);
|
||||
result = that._showContainerWidget($target);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
deactivate: function() {
|
||||
var that = this,
|
||||
result;
|
||||
|
||||
result = that._hideContainerWidget();
|
||||
|
||||
result.done(function() {
|
||||
that._base().deactivate.call(that);
|
||||
that.childController.deactivate();
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
showView: function(viewInfo, direction) {
|
||||
return this.childController.showView(viewInfo, direction);
|
||||
}
|
||||
});
|
||||
|
||||
var PopupLayoutController = OverlayLayoutControllerBase.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "popup";
|
||||
options.contentContainerSelector = options.contentContainerSelector || ".child-controller-content";
|
||||
this.isOverlay = true;
|
||||
this._targetContainer = options.targetContainer;
|
||||
this.callBase(options)
|
||||
}, init: function(options) {
|
||||
this.callBase(options);
|
||||
this._popup = this._$mainLayout.find(".popup-container").dxPopup("instance");
|
||||
if (this._targetContainer) {
|
||||
this._popup.option("container", this._targetContainer)
|
||||
}
|
||||
}, _showContainerWidget: function() {
|
||||
return this._popup.show()
|
||||
}, _hideContainerWidget: function() {
|
||||
return this._popup.hide()
|
||||
}
|
||||
});
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "popup";
|
||||
options.contentContainerSelector = options.contentContainerSelector || ".child-controller-content";
|
||||
this.isOverlay = true;
|
||||
this._targetContainer = options.targetContainer;
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this._popup = this._$mainLayout.find(".popup-container").dxPopup("instance");
|
||||
if (this._targetContainer) {
|
||||
this._popup.option("container", this._targetContainer);
|
||||
}
|
||||
},
|
||||
|
||||
_showContainerWidget: function() {
|
||||
return this._popup.show();
|
||||
},
|
||||
|
||||
_hideContainerWidget: function() {
|
||||
return this._popup.hide();
|
||||
}
|
||||
});
|
||||
|
||||
$.each(["navbar", "simple", "slideout", "pivot", "split"], function(index, name) {
|
||||
layoutSets[name] = layoutSets[name] || [];
|
||||
$.each(layoutSets[name], function(index, layoutInfo) {
|
||||
layoutInfo.modal = false
|
||||
layoutInfo.modal = false;
|
||||
});
|
||||
layoutSets[name].push({
|
||||
modal: true, controller: new PopupLayoutController
|
||||
})
|
||||
modal: true,
|
||||
controller: new PopupLayoutController()
|
||||
});
|
||||
});
|
||||
|
||||
exports.OverlayLayoutControllerBase = OverlayLayoutControllerBase;
|
||||
exports.PopupLayoutController = PopupLayoutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Layout */
|
||||
/* Layout */
|
||||
|
||||
.simple-layout,
|
||||
.simple-layout-tablet {
|
||||
@@ -229,4 +229,4 @@
|
||||
|
||||
.dx-theme-win10 .simple-layout.dx-animating:not(.dx-enter):not(.dx-leave) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="simple-layout" data-options="dxLayout : { name: 'simple', platform: 'win', phone: false, version: [8] } ">
|
||||
<div class="simple-layout" data-options="dxLayout : { name: 'simple', platform: 'win', phone: false, version: [8] } ">
|
||||
<div class="layout-frame" data-options="dxTransition: { name: 'main', animation: 'view-content-change' }">
|
||||
<div class="layout-header">
|
||||
<div data-bind="dxToolbar: { items: [{ text: title, location: 'center' }] }"
|
||||
|
||||
@@ -1,124 +1,206 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("core/class"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("core/devices"), require("core/errors").log, require("ui/toolbar"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("core/class"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
require("core/devices"),
|
||||
require("core/errors").log,
|
||||
|
||||
require("ui/toolbar")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.SimpleLayout = factory(jQuery, DevExpress.Class, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController, DevExpress.devices, DevExpress.errors.log);
|
||||
root.DevExpress.layouts.SimpleLayout = factory(
|
||||
jQuery,
|
||||
DevExpress.Class,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController,
|
||||
DevExpress.devices,
|
||||
DevExpress.errors.log
|
||||
);
|
||||
root.DevExpress.framework.html.SimpleLayoutController = root.DevExpress.layouts.SimpleLayout.SimpleLayoutController;
|
||||
root.DevExpress.framework.html.Win8SimpleLayoutController = root.DevExpress.layouts.SimpleLayout.Win8SimpleLayoutController
|
||||
root.DevExpress.framework.html.Win8SimpleLayoutController = root.DevExpress.layouts.SimpleLayout.Win8SimpleLayoutController;
|
||||
}
|
||||
}(this, function($, Class, layoutSets, DefaultLayoutController, devices, log) {
|
||||
}(window, function($, Class, layoutSets, DefaultLayoutController, devices, log) {
|
||||
|
||||
var exports = {};
|
||||
|
||||
var SimpleLayoutController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "simple";
|
||||
this.callBase(options);
|
||||
var device = devices.current();
|
||||
if (device.win && device.phone || options.Win8SimpleLayoutControllerFroced) {
|
||||
this.impl = new Win8SimpleLayoutImpl($.proxy(this._getViewFrame, this))
|
||||
}
|
||||
else {
|
||||
this.impl = new SimpleLayoutImpl
|
||||
}
|
||||
}, _onRenderComplete: function(viewInfo) {
|
||||
this.impl.onRenderComplete(viewInfo);
|
||||
this.callBase.apply(this, arguments)
|
||||
}, disposeView: function(viewInfo) {
|
||||
this.impl.disposeView(viewInfo);
|
||||
this.callBase.apply(this, arguments)
|
||||
}, _changeView: function(viewInfo) {
|
||||
var that = this,
|
||||
result = this.callBase.apply(this, arguments);
|
||||
result.done(function() {
|
||||
that.impl.changeView(viewInfo)
|
||||
});
|
||||
return result
|
||||
}
|
||||
});
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "simple";
|
||||
this.callBase(options);
|
||||
|
||||
var device = devices.current();
|
||||
|
||||
if (device.win && device.phone || options.Win8SimpleLayoutControllerForced) {
|
||||
this.impl = new Win8SimpleLayoutImpl($.proxy(this._getViewFrame, this));
|
||||
} else {
|
||||
this.impl = new SimpleLayoutImpl();
|
||||
}
|
||||
},
|
||||
|
||||
_onRenderComplete: function(viewInfo) {
|
||||
this.impl.onRenderComplete(viewInfo);
|
||||
this.callBase.apply(this, arguments);
|
||||
},
|
||||
|
||||
disposeView: function(viewInfo) {
|
||||
this.impl.disposeView(viewInfo);
|
||||
this.callBase.apply(this, arguments);
|
||||
},
|
||||
|
||||
_changeView: function(viewInfo) {
|
||||
var that = this,
|
||||
result = this.callBase.apply(this, arguments);
|
||||
|
||||
result.done(function() {
|
||||
that.impl.changeView(viewInfo);
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
var SimpleLayoutImpl = Class.inherit({
|
||||
ctor: $.noop, onRenderComplete: $.noop, disposeView: $.noop, changeView: $.noop
|
||||
});
|
||||
ctor: $.noop,
|
||||
onRenderComplete: $.noop,
|
||||
disposeView: $.noop,
|
||||
changeView: $.noop
|
||||
});
|
||||
|
||||
var HAS_TOOLBAR_BOTTOM_CLASS = "has-toolbar-bottom",
|
||||
LAYOUT_TOOLBAR_BOTTOM_SELECTOR = ".layout-toolbar-bottom";
|
||||
|
||||
var Win8SimpleLayoutImpl = SimpleLayoutImpl.inherit({
|
||||
ctor: function(viewFrameGetter) {
|
||||
this._getViewFrame = viewFrameGetter;
|
||||
this.callBase.apply(this, arguments);
|
||||
this._toolbarOptionChangedHandler = $.proxy(this._onToolbarOptionChanged, this)
|
||||
}, _onToolbarOptionChanged: function(args) {
|
||||
if (args.name === "items") {
|
||||
var appbar = args.component;
|
||||
if (appbar) {
|
||||
this._refreshAppbarVisibility(appbar)
|
||||
}
|
||||
this._refreshHasToolbarClass()
|
||||
}
|
||||
}, _getAppbar: function($markup) {
|
||||
var $appbar = $markup.find(LAYOUT_TOOLBAR_BOTTOM_SELECTOR);
|
||||
if ($appbar.length !== 1) {
|
||||
return
|
||||
}
|
||||
return $appbar.dxToolbar("instance")
|
||||
}, _getCurrentAppbar: function() {
|
||||
return this._getAppbar(this._getViewFrame().find(".dx-active-view "))
|
||||
}, onRenderComplete: function(viewInfo) {
|
||||
var appbar = this._getAppbar(viewInfo.renderResult.$markup);
|
||||
if (appbar) {
|
||||
this._refreshAppbarVisibility(appbar);
|
||||
appbar.on("optionChanged", this._toolbarOptionChangedHandler)
|
||||
}
|
||||
}, disposeView: function(viewInfo) {
|
||||
var appbar = this._getAppbar(viewInfo.renderResult.$markup);
|
||||
if (appbar) {
|
||||
appbar.off("optionChanged", this._toolbarOptionChangedHandler)
|
||||
}
|
||||
}, changeView: function(viewInfo) {
|
||||
this._refreshHasToolbarClass()
|
||||
}, _refreshAppbarVisibility: function(appbar) {
|
||||
var isAppbarNotEmpty = false;
|
||||
$.each(appbar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppbarNotEmpty = true;
|
||||
return false
|
||||
}
|
||||
});
|
||||
appbar.option("visible", isAppbarNotEmpty)
|
||||
}, _refreshHasToolbarClass: function() {
|
||||
var appbar = this._getCurrentAppbar(),
|
||||
hasToolbar = appbar ? appbar.option("visible") : false;
|
||||
this._getViewFrame().toggleClass(HAS_TOOLBAR_BOTTOM_CLASS, hasToolbar)
|
||||
ctor: function(viewFrameGetter) {
|
||||
this._getViewFrame = viewFrameGetter;
|
||||
this.callBase.apply(this, arguments);
|
||||
this._toolbarOptionChangedHandler = $.proxy(this._onToolbarOptionChanged, this);
|
||||
},
|
||||
|
||||
_onToolbarOptionChanged: function(args) {
|
||||
if (args.name === "items") {
|
||||
var appBar = args.component;
|
||||
|
||||
if (appBar) {
|
||||
this._refreshAppBarVisibility(appBar);
|
||||
}
|
||||
});
|
||||
var Win8SimpleLayoutController = SimpleLayoutController.inherit({ctor: function(options) {
|
||||
options = options || {};
|
||||
options.Win8SimpleLayoutControllerFroced = true;
|
||||
log("W0000", "Layouts", "Win8SimpleLayoutController", "15.1", "Use the SimpleLayoutController instead");
|
||||
this.callBase.apply(this, arguments)
|
||||
}});
|
||||
this._refreshHasToolbarClass();
|
||||
}
|
||||
},
|
||||
|
||||
_getAppBar: function($markup) {
|
||||
var $appBar = $markup.find(LAYOUT_TOOLBAR_BOTTOM_SELECTOR);
|
||||
|
||||
if ($appBar.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $appBar.dxToolbar("instance");
|
||||
},
|
||||
|
||||
_getCurrentAppBar: function() {
|
||||
return this._getAppBar(this._getViewFrame().find(".dx-active-view "));
|
||||
},
|
||||
|
||||
onRenderComplete: function(viewInfo) {
|
||||
var appBar = this._getAppBar(viewInfo.renderResult.$markup);
|
||||
|
||||
if (appBar) {
|
||||
this._refreshAppBarVisibility(appBar);
|
||||
appBar.on("optionChanged", this._toolbarOptionChangedHandler);
|
||||
}
|
||||
},
|
||||
|
||||
disposeView: function(viewInfo) {
|
||||
var appBar = this._getAppBar(viewInfo.renderResult.$markup);
|
||||
|
||||
if (appBar) {
|
||||
appBar.off("optionChanged", this._toolbarOptionChangedHandler);
|
||||
}
|
||||
},
|
||||
|
||||
changeView: function(viewInfo) {
|
||||
this._refreshHasToolbarClass();
|
||||
},
|
||||
|
||||
_refreshAppBarVisibility: function(appBar) {
|
||||
var isAppBarNotEmpty = false;
|
||||
|
||||
$.each(appBar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppBarNotEmpty = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
appBar.option("visible", isAppBarNotEmpty);
|
||||
},
|
||||
|
||||
_refreshHasToolbarClass: function() {
|
||||
var appBar = this._getCurrentAppBar(),
|
||||
hasToolbar = appBar ? appBar.option("visible") : false;
|
||||
|
||||
this._getViewFrame().toggleClass(HAS_TOOLBAR_BOTTOM_CLASS, hasToolbar);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var Win8SimpleLayoutController = SimpleLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.Win8SimpleLayoutControllerForced = true;
|
||||
// deprecated since 15.2
|
||||
|
||||
this.callBase.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
layoutSets["navbar"] = layoutSets["navbar"] || [];
|
||||
layoutSets["navbar"].push({
|
||||
platform: "win", root: false, phone: true, controller: new SimpleLayoutController
|
||||
platform: "win",
|
||||
root: false,
|
||||
phone: true,
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
layoutSets["navbar"].push({
|
||||
platform: "android", root: false, controller: new SimpleLayoutController
|
||||
platform: "android",
|
||||
root: false,
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
|
||||
layoutSets["simple"] = layoutSets["simple"] || [];
|
||||
layoutSets["simple"].push({controller: new SimpleLayoutController});
|
||||
layoutSets["simple"].push({
|
||||
platform: "win", phone: true, controller: new SimpleLayoutController
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
layoutSets["simple"].push({
|
||||
platform: "win",
|
||||
phone: true,
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
|
||||
layoutSets["split"] = layoutSets["split"] || [];
|
||||
layoutSets["split"].push({
|
||||
platform: "win", requireCustomResolve: true, controller: new SimpleLayoutController
|
||||
platform: "win",
|
||||
requireCustomResolve: true,
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "win", root: false, phone: true, controller: new SimpleLayoutController
|
||||
platform: "win",
|
||||
root: false,
|
||||
phone: true,
|
||||
controller: new SimpleLayoutController()
|
||||
});
|
||||
|
||||
exports.SimpleLayoutController = SimpleLayoutController;
|
||||
exports.Win8SimpleLayoutController = Win8SimpleLayoutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
.slideout-layout {
|
||||
.slideout-layout {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
.dx-theme-android5 .slideout-layout .layout-content,
|
||||
.dx-theme-android5 .dx-slideout .dx-slideout-item-container .dx-slideoutview-shield {
|
||||
top: 56px;
|
||||
top: 56px;
|
||||
}
|
||||
|
||||
.dx-theme-android5 .slideout-layout .layout-frame,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="text/html" id="slideOutMenuItemTemplate">
|
||||
<script type="text/html" id="slideOutMenuItemTemplate">
|
||||
<div data-bind="visible: visible, css: { 'dx-state-disabled': disabled }" data-options="dxTemplate : { name: 'item' } ">
|
||||
<div>
|
||||
<!-- ko dxIcon: $data.icon || $data.iconSrc --><!-- /ko -->
|
||||
|
||||
@@ -1,140 +1,226 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("animation/fx"), require("core/devices"), require("ui/slide_out"), require("ui/toolbar"), require("ui/button"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.SlideOutLayout = factory(jQuery, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController, DevExpress.fx, DevExpress.devices);
|
||||
root.DevExpress.framework.html.SlideOutController = root.DevExpress.layouts.SlideOutLayout.SlideOutController
|
||||
}
|
||||
}(this, function($, layoutSets, DefaultLayoutController, fx, devices) {
|
||||
var exports = {};
|
||||
var SlideOutController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "slideout";
|
||||
this.swipeEnabled = options.swipeEnabled === undefined ? true : options.swipeEnabled;
|
||||
this.callBase(options)
|
||||
}, init: function(options) {
|
||||
this.callBase(options);
|
||||
this._navigationManager = options.navigationManager;
|
||||
this._navigationCanceledHandler = $.proxy(this._onNavigatingCanceled, this)
|
||||
}, activate: function() {
|
||||
var result = this.callBase.apply(this, arguments);
|
||||
this._navigationManager.on("navigationCanceled", this._navigationCanceledHandler);
|
||||
return result
|
||||
}, deactivate: function() {
|
||||
this._navigationManager.off("navigationCanceled", this._navigationCanceledHandler);
|
||||
return this.callBase.apply(this, arguments)
|
||||
}, disable: function() {
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
this._toggleNavigation()
|
||||
}
|
||||
return this.callBase.apply(this, arguments)
|
||||
}, _onNavigatingCanceled: function(args) {
|
||||
if (this.slideOut.option("menuVisible") && args.cancelReason !== "redirect") {
|
||||
this._toggleNavigation()
|
||||
}
|
||||
}, _createNavigationWidget: function() {
|
||||
this.$slideOut = $("<div data-bind='dxSlideOut: { menuItemTemplate: $(\"#slideOutMenuItemTemplate\"), contentTemplate: \" \" }'></div>").dxCommandContainer({id: 'global-navigation'});
|
||||
this._applyTemplate(this.$slideOut, this._layoutModel);
|
||||
this.callBase();
|
||||
this.slideOut = this.$slideOut.dxSlideOut("instance");
|
||||
this.slideOut.option("swipeEnabled", this.swipeEnabled);
|
||||
this.$slideOut.find(".dx-slideout-item-container").append(this._$mainLayout);
|
||||
return this.$slideOut
|
||||
}, _renderNavigationImpl: function(navigationCommands) {
|
||||
var container = this.$slideOut.dxCommandContainer("instance");
|
||||
this._commandManager.renderCommandsToContainers(navigationCommands, [container])
|
||||
}, element: function() {
|
||||
return this.$slideOut
|
||||
}, _showViewImpl: function(viewInfo, direction, previousViewTemplateId) {
|
||||
this._fxOffSaved = fx.off;
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
fx.off = true
|
||||
}
|
||||
return this.callBase.apply(this, arguments)
|
||||
}, _getReadyForRenderDeferredItems: function(viewInfo) {
|
||||
var result = this.callBase(viewInfo);
|
||||
fx.off = this._fxOffSaved;
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
result = $.when(this._toggleNavigation(), result)
|
||||
}
|
||||
return result
|
||||
}, _onViewShown: function(viewInfo) {
|
||||
this._refreshVisibility()
|
||||
}, _refreshVisibility: function() {
|
||||
if (devices.real().platform === "android") {
|
||||
this.$slideOut.css("backface-visibility", "hidden");
|
||||
this.$slideOut.css("backface-visibility");
|
||||
this.$slideOut.css("backface-visibility", "visible")
|
||||
}
|
||||
}, _viewHasBackCommands: function(viewInfo) {
|
||||
var hasBackCommands = false;
|
||||
$.each(viewInfo.commands, function(index, command) {
|
||||
if (((command.option("behavior") === "back" || command.option("id") === "back")) && command.option("visible")) {
|
||||
hasBackCommands = true;
|
||||
return false
|
||||
}
|
||||
});
|
||||
return hasBackCommands
|
||||
}, _onRenderComplete: function(viewInfo) {
|
||||
var that = this;
|
||||
if (!that._viewHasBackCommands(viewInfo)) {
|
||||
that._initNavigationButton(viewInfo.renderResult.$markup)
|
||||
}
|
||||
var $content = viewInfo.renderResult.$markup.find(".layout-content"),
|
||||
$appbar = viewInfo.renderResult.$markup.find(".layout-toolbar-bottom"),
|
||||
appbar = $appbar.dxToolbar("instance");
|
||||
if (appbar) {
|
||||
that._refreshAppbarVisibility(appbar, $content);
|
||||
appbar.on("optionChanged", function(args) {
|
||||
if (args.name === "items") {
|
||||
that._refreshAppbarVisibility(appbar, $content)
|
||||
}
|
||||
})
|
||||
}
|
||||
}, _refreshAppbarVisibility: function(appbar, $content) {
|
||||
var isAppbarNotEmpty = false;
|
||||
$.each(appbar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppbarNotEmpty = true;
|
||||
return false
|
||||
}
|
||||
});
|
||||
$content.toggleClass("has-toolbar-bottom", isAppbarNotEmpty);
|
||||
appbar.option("visible", isAppbarNotEmpty)
|
||||
}, _initNavigationButton: function($markup) {
|
||||
var that = this,
|
||||
$toolbar = $markup.find(".layout-toolbar"),
|
||||
toolbar = $toolbar.dxToolbar("instance");
|
||||
var initNavButton = function() {
|
||||
toolbar.option("items[0].visible", true);
|
||||
$toolbar.find(".nav-button").dxButton("instance").option("onClick", $.proxy(that._toggleNavigation, that, $markup))
|
||||
};
|
||||
initNavButton();
|
||||
toolbar.on("contentReady", function(args) {
|
||||
initNavButton()
|
||||
})
|
||||
}, _toggleNavigation: function($markup) {
|
||||
return this.slideOut.toggleMenuVisibility()
|
||||
}
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
require("animation/fx"),
|
||||
require("core/devices"),
|
||||
|
||||
require("ui/slide_out"),
|
||||
require("ui/toolbar"),
|
||||
require("ui/button")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.SlideOutLayout = factory(
|
||||
jQuery,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController,
|
||||
DevExpress.fx,
|
||||
DevExpress.devices
|
||||
);
|
||||
root.DevExpress.framework.html.SlideOutController = root.DevExpress.layouts.SlideOutLayout.SlideOutController;
|
||||
}
|
||||
}(window, function($, layoutSets, DefaultLayoutController, fx, devices) {
|
||||
|
||||
var exports = {};
|
||||
|
||||
var SlideOutController = DefaultLayoutController.inherit({
|
||||
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "slideout";
|
||||
this.swipeEnabled = options.swipeEnabled === undefined ? true : options.swipeEnabled;
|
||||
this.callBase(options);
|
||||
},
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this._navigationManager = options.navigationManager;
|
||||
this._navigationCanceledHandler = $.proxy(this._onNavigatingCanceled, this);
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
var result = this.callBase.apply(this, arguments);
|
||||
|
||||
this._navigationManager.on("navigationCanceled", this._navigationCanceledHandler);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
deactivate: function() {
|
||||
this._navigationManager.off("navigationCanceled", this._navigationCanceledHandler);
|
||||
|
||||
return this.callBase.apply(this, arguments);
|
||||
},
|
||||
|
||||
disable: function() {
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
this._toggleNavigation();
|
||||
}
|
||||
|
||||
return this.callBase.apply(this, arguments);
|
||||
},
|
||||
|
||||
_onNavigatingCanceled: function(args) {
|
||||
if (this.slideOut.option("menuVisible") && args.cancelReason !== "redirect") {
|
||||
this._toggleNavigation();
|
||||
}
|
||||
},
|
||||
_createNavigationWidget: function() {
|
||||
this.$slideOut = $("<div data-bind='dxSlideOut: { menuItemTemplate: $(\"#slideOutMenuItemTemplate\"), contentTemplate: \" \" }'></div>")
|
||||
.dxCommandContainer({
|
||||
id: 'global-navigation'
|
||||
});
|
||||
|
||||
this._applyTemplate(this.$slideOut, this._layoutModel);
|
||||
|
||||
this.callBase();
|
||||
|
||||
this.slideOut = this.$slideOut.dxSlideOut("instance");
|
||||
this.slideOut.option("swipeEnabled", this.swipeEnabled);
|
||||
this.$slideOut.find(".dx-slideout-item-container").append(this._$mainLayout);
|
||||
return this.$slideOut;
|
||||
},
|
||||
|
||||
_renderNavigationImpl: function(navigationCommands) {
|
||||
var container = this.$slideOut.dxCommandContainer("instance");
|
||||
this._commandManager.renderCommandsToContainers(navigationCommands, [container]);
|
||||
},
|
||||
|
||||
element: function() {
|
||||
return this.$slideOut;
|
||||
},
|
||||
|
||||
_showViewImpl: function(viewInfo, direction, previousViewTemplateId) {
|
||||
this._fxOffSaved = fx.off;
|
||||
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
fx.off = true;
|
||||
}
|
||||
|
||||
return this.callBase.apply(this, arguments);
|
||||
},
|
||||
|
||||
_getReadyForRenderDeferredItems: function(viewInfo) {
|
||||
var result = this.callBase(viewInfo);
|
||||
|
||||
fx.off = this._fxOffSaved;
|
||||
if (this.slideOut.option("menuVisible")) {
|
||||
result = $.when(this._toggleNavigation(), result);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
_onViewShown: function(viewInfo) {
|
||||
this._refreshVisibility();
|
||||
},
|
||||
|
||||
_refreshVisibility: function() {
|
||||
// NOTE : T111662 - View rendering only after tap on it
|
||||
if (devices.real().platform === "android") {
|
||||
this.$slideOut.css("backface-visibility", "hidden");
|
||||
this.$slideOut.css("backface-visibility");
|
||||
this.$slideOut.css("backface-visibility", "visible");
|
||||
}
|
||||
},
|
||||
|
||||
_viewHasBackCommands: function(viewInfo) {
|
||||
var hasBackCommands = false;
|
||||
|
||||
$.each(viewInfo.commands, function(index, command) {
|
||||
if (((command.option("behavior") === "back" || command.option("id") === "back")) && command.option("visible")) {
|
||||
hasBackCommands = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return hasBackCommands;
|
||||
},
|
||||
|
||||
_onRenderComplete: function(viewInfo) {
|
||||
var that = this;
|
||||
|
||||
if (!that._viewHasBackCommands(viewInfo)) {
|
||||
that._initNavigationButton(viewInfo.renderResult.$markup);
|
||||
}
|
||||
|
||||
var $content = viewInfo.renderResult.$markup.find(".layout-content"),
|
||||
$appBar = viewInfo.renderResult.$markup.find(".layout-toolbar-bottom"),
|
||||
appBar = $appBar.dxToolbar("instance");
|
||||
|
||||
if (appBar) {
|
||||
that._refreshAppBarVisibility(appBar, $content);
|
||||
appBar.on("optionChanged", function(args) {
|
||||
if (args.name === "items") {
|
||||
that._refreshAppBarVisibility(appBar, $content);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_refreshAppBarVisibility: function(appBar, $content) {
|
||||
var isAppBarNotEmpty = false;
|
||||
|
||||
$.each(appBar.option("items"), function(index, item) {
|
||||
if (item.visible) {
|
||||
isAppBarNotEmpty = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$content.toggleClass("has-toolbar-bottom", isAppBarNotEmpty);
|
||||
appBar.option("visible", isAppBarNotEmpty);
|
||||
},
|
||||
|
||||
_initNavigationButton: function($markup) {
|
||||
var that = this,
|
||||
$toolbar = $markup.find(".layout-toolbar"),
|
||||
toolbar = $toolbar.dxToolbar("instance");
|
||||
|
||||
var initNavButton = function() {
|
||||
toolbar.option("items[0].visible", true); //nav button item
|
||||
$toolbar.find(".nav-button").dxButton("instance").option("onClick", $.proxy(that._toggleNavigation, that, $markup));
|
||||
};
|
||||
|
||||
initNavButton();
|
||||
|
||||
toolbar.on("contentReady", function(args) {
|
||||
initNavButton();
|
||||
});
|
||||
},
|
||||
|
||||
_toggleNavigation: function($markup) {
|
||||
return this.slideOut.toggleMenuVisibility();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
layoutSets["slideout"] = layoutSets["slideout"] || [];
|
||||
layoutSets["slideout"].push({
|
||||
platform: "ios", controller: new SlideOutController
|
||||
platform: "ios",
|
||||
controller: new SlideOutController()
|
||||
});
|
||||
layoutSets["slideout"].push({
|
||||
platform: "android", controller: new SlideOutController
|
||||
platform: "android",
|
||||
controller: new SlideOutController()
|
||||
});
|
||||
layoutSets["slideout"].push({
|
||||
platform: "generic", controller: new SlideOutController
|
||||
platform: "generic",
|
||||
controller: new SlideOutController()
|
||||
});
|
||||
layoutSets["slideout"].push({
|
||||
platform: "win", controller: new SlideOutController
|
||||
platform: "win",
|
||||
controller: new SlideOutController()
|
||||
});
|
||||
|
||||
exports.SlideOutController = SlideOutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
.dx-viewport {
|
||||
.dx-viewport {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
@@ -9,7 +9,7 @@
|
||||
-ms-grid-columns: 620px 1fr;
|
||||
-ms-grid-rows: 104px 1fr;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.dx-theme-win8 .split-layout .layout-header {
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
|
||||
.dx-theme-win8 .split-layout .left-content {
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-row: 2;
|
||||
padding: 60px 0 0 120px;
|
||||
}
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
.dx-theme-win8 .split-layout .right-content {
|
||||
-ms-grid-column: 2;
|
||||
-ms-grid-column: 2;
|
||||
-ms-grid-row: 2;
|
||||
padding: 60px 0 0 0;
|
||||
}
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
.dx-theme-win8 .split-layout .dx-app-bar {
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
z-index: 1000;
|
||||
width: 100%;
|
||||
bottom: -104px;
|
||||
transition: bottom .4s;
|
||||
@@ -117,7 +117,7 @@
|
||||
-ms-grid-columns: 1fr 3fr;
|
||||
-ms-grid-rows: 60px 1fr;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.dx-theme-win10 .split-layout .layout-header {
|
||||
@@ -139,13 +139,13 @@
|
||||
}
|
||||
|
||||
.dx-theme-win10 .split-layout .left-content {
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-column: 1;
|
||||
-ms-grid-row: 2;
|
||||
background-color: #171717;
|
||||
}
|
||||
|
||||
.dx-theme-win10 .split-layout .right-content {
|
||||
-ms-grid-column: 2;
|
||||
-ms-grid-column: 2;
|
||||
-ms-grid-row: 2;
|
||||
}
|
||||
|
||||
@@ -207,4 +207,4 @@
|
||||
top: 48px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="master-detail-layout" data-options="dxLayout : { name: 'split', tablet: true, platform: 'ios' }">
|
||||
<div class="master-detail-layout" data-options="dxLayout : { name: 'split', tablet: true, platform: 'ios' }">
|
||||
<div class="master-pane dx-splitter">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,20 +1,45 @@
|
||||
"use strict";
|
||||
(function(root, factory) {
|
||||
/* global define, DevExpress, jQuery */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function(require, exports, module) {
|
||||
module.exports = factory(require("jquery"), require("knockout"), require("core/class"), require("framework/errors"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("../Empty/EmptyLayout.js"), require("../Simple/SimpleLayout.js"), require("animation/fx"), require("ui/toolbar"))
|
||||
})
|
||||
}
|
||||
else {
|
||||
module.exports = factory(
|
||||
require("jquery"),
|
||||
require("knockout"),
|
||||
require("core/class"),
|
||||
require("framework/errors"),
|
||||
require("framework/html/presets").layoutSets,
|
||||
require("framework/html/layout_controller").DefaultLayoutController,
|
||||
require("../Empty/EmptyLayout.js"),
|
||||
require("../Simple/SimpleLayout.js"),
|
||||
require("animation/fx"),
|
||||
|
||||
require("ui/toolbar")
|
||||
);
|
||||
});
|
||||
} else {
|
||||
root.DevExpress.layouts = root.DevExpress.layouts || {};
|
||||
root.DevExpress.layouts.SplitLayout = factory(jQuery, window.ko, DevExpress.Class, DevExpress.framework.errors, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController, DevExpress.layouts.EmptyLayout, DevExpress.layouts.SimpleLayout, DevExpress.fx);
|
||||
root.DevExpress.layouts.SplitLayout = factory(
|
||||
jQuery,
|
||||
window.ko,
|
||||
DevExpress.Class,
|
||||
DevExpress.framework.errors,
|
||||
DevExpress.framework.html.layoutSets,
|
||||
DevExpress.framework.html.DefaultLayoutController,
|
||||
DevExpress.layouts.EmptyLayout,
|
||||
DevExpress.layouts.SimpleLayout,
|
||||
DevExpress.fx
|
||||
);
|
||||
|
||||
root.DevExpress.framework.html.MultipaneLayoutController = root.DevExpress.layouts.SplitLayout.MultipaneLayoutController;
|
||||
root.DevExpress.framework.html.IOSSplitLayoutController = root.DevExpress.layouts.SplitLayout.IOSSplitLayoutController;
|
||||
root.DevExpress.framework.html.ToolbarController = root.DevExpress.layouts.SplitLayout.ToolbarController;
|
||||
root.DevExpress.framework.html.AndroidSplitLayoutController = root.DevExpress.layouts.SplitLayout.AndroidSplitLayoutController;
|
||||
root.DevExpress.framework.html.WinSplitLayoutController = root.DevExpress.layouts.SplitLayout.WinSplitLayoutController;
|
||||
root.DevExpress.framework.html.Win8SplitLayoutController = root.DevExpress.layouts.SplitLayout.Win8SplitLayoutController
|
||||
root.DevExpress.framework.html.Win8SplitLayoutController = root.DevExpress.layouts.SplitLayout.Win8SplitLayoutController;
|
||||
}
|
||||
}(this, function($, ko, Class, errors, layoutSets, DefaultLayoutController, EmptyLayoutControllerModule, SimpleLayoutControllerModule, fx) {
|
||||
}(window, function($, ko, Class, errors, layoutSets, DefaultLayoutController, EmptyLayoutControllerModule, SimpleLayoutControllerModule, fx) {
|
||||
|
||||
var exports = {},
|
||||
APPBAR_TOUCH_AREA_HEIGHT = 50,
|
||||
APPBAR_TOUCH_THRESHOLD = 50,
|
||||
@@ -24,358 +49,524 @@
|
||||
POINTER_DOWN_EVENT_NAME,
|
||||
POINTER_UP_EVENT_NAME,
|
||||
POINTER_MOVE_EVENT_NAME;
|
||||
|
||||
|
||||
if (window.PointerEvent) {
|
||||
POINTER_DOWN_EVENT_NAME = "pointerdown";
|
||||
POINTER_UP_EVENT_NAME = "pointerup";
|
||||
POINTER_MOVE_EVENT_NAME = "pointermove"
|
||||
}
|
||||
else if (window.MSPointerEvent) {
|
||||
POINTER_MOVE_EVENT_NAME = "pointermove";
|
||||
} else if (window.MSPointerEvent) {
|
||||
POINTER_DOWN_EVENT_NAME = "MSPointerDown";
|
||||
POINTER_UP_EVENT_NAME = "MSPointerUp";
|
||||
POINTER_MOVE_EVENT_NAME = "MSPointerMove"
|
||||
}
|
||||
else {
|
||||
POINTER_MOVE_EVENT_NAME = "MSPointerMove";
|
||||
} else {
|
||||
POINTER_DOWN_EVENT_NAME = "mousedown";
|
||||
POINTER_UP_EVENT_NAME = "mouseup";
|
||||
POINTER_MOVE_EVENT_NAME = "mousemove"
|
||||
POINTER_MOVE_EVENT_NAME = "mousemove";
|
||||
}
|
||||
|
||||
var SplitLayoutEventHelper = Class.inherit({
|
||||
ctor: function(splitLayout) {
|
||||
this.root = splitLayout
|
||||
}, init: function() {
|
||||
this.root._$viewPort.on(POINTER_UP_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerUpHandler, this));
|
||||
this.root._$viewPort.on(POINTER_DOWN_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerDownHandler, this));
|
||||
$(document).on("keydown" + EVENTS_NAMESPACE, $.proxy(this._keyDownHandler, this));
|
||||
$(document).on("keyup" + EVENTS_NAMESPACE, $.proxy(this._keyUpHandler, this));
|
||||
this._startTouchPoint = false;
|
||||
this._winKeyPressed = false;
|
||||
this._moveEvent = false;
|
||||
this._appbarBehavior = true
|
||||
}, _pointerDownHandler: function(e) {
|
||||
var originalEvent = e.originalEvent;
|
||||
if (this._isTouch(originalEvent) && this._startedInAppBarArea(originalEvent)) {
|
||||
this._startTouchPoint = {
|
||||
x: originalEvent.clientX, y: originalEvent.clientY
|
||||
};
|
||||
this.root._$viewPort.on(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerMoveHandler, this))
|
||||
}
|
||||
}, _pointerMoveHandler: function(e) {
|
||||
var originalEvent = e.originalEvent;
|
||||
if (this._thresholdExceeded(originalEvent)) {
|
||||
this._moveEvent = true;
|
||||
this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
|
||||
if (this._isVerticalDirection(originalEvent.clientX, originalEvent.clientY))
|
||||
this._toggleAppBarState(true)
|
||||
}
|
||||
}, _pointerUpHandler: function(e) {
|
||||
this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
|
||||
var $appBar = this.root._$viewPort.find(".dx-app-bar");
|
||||
if (e.originalEvent.button === 2) {
|
||||
this._toggleAppBarState()
|
||||
}
|
||||
else if (!this._moveEvent && $appBar[0] && !$appBar[0].contains(e.target)) {
|
||||
this._toggleAppBarState(false)
|
||||
}
|
||||
this._moveEvent = false
|
||||
}, _keyDownHandler: function(e) {
|
||||
if (e.keyCode === KEYCODE_WIN) {
|
||||
this._winKeyPressed = true
|
||||
}
|
||||
}, _keyUpHandler: function(e) {
|
||||
if (this._winKeyPressed && (e.keyCode === KEYCODE_Z)) {
|
||||
this._toggleAppBarState()
|
||||
}
|
||||
else if (e.keyCode === KEYCODE_WIN) {
|
||||
this._winKeyPressed = false
|
||||
}
|
||||
}, _toggleAppBarState: function(state) {
|
||||
if (!this.root._appBarHasCommands())
|
||||
return;
|
||||
this.root._$viewPort.find(".dx-app-bar").toggleClass("dx-app-bar-visible", !this._appbarBehavior || state)
|
||||
}, _isVerticalDirection: function(x, y) {
|
||||
return Math.abs(y - this._startTouchPoint.y) > Math.abs(x - this._startTouchPoint.x)
|
||||
}, _isTouch: function(event) {
|
||||
return event.pointerType === event.MSPOINTER_TYPE_TOUCH || event.pointerType === event.MSPOINTER_TYPE_PEN
|
||||
}, _startedInAppBarArea: function(event) {
|
||||
return (this.root._$viewPort.height() - APPBAR_TOUCH_AREA_HEIGHT) < event.clientY
|
||||
}, _thresholdExceeded: function(originalEvent) {
|
||||
return originalEvent.clientY < (this._startTouchPoint.y - APPBAR_TOUCH_THRESHOLD)
|
||||
|
||||
ctor: function(splitLayout) {
|
||||
this.root = splitLayout;
|
||||
},
|
||||
|
||||
init: function() {
|
||||
this.root._$viewPort.on(POINTER_UP_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerUpHandler, this));
|
||||
this.root._$viewPort.on(POINTER_DOWN_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerDownHandler, this));
|
||||
$(document).on("keydown" + EVENTS_NAMESPACE, $.proxy(this._keyDownHandler, this));
|
||||
$(document).on("keyup" + EVENTS_NAMESPACE, $.proxy(this._keyUpHandler, this));
|
||||
|
||||
this._startTouchPoint = false;
|
||||
this._winKeyPressed = false;
|
||||
this._moveEvent = false;
|
||||
|
||||
this._appBarBehavior = true;
|
||||
},
|
||||
|
||||
_pointerDownHandler: function(e) {
|
||||
var originalEvent = e.originalEvent;
|
||||
|
||||
if (this._isTouch(originalEvent) && this._startedInAppBarArea(originalEvent)) {
|
||||
this._startTouchPoint = {
|
||||
x: originalEvent.clientX,
|
||||
y: originalEvent.clientY
|
||||
};
|
||||
this.root._$viewPort.on(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerMoveHandler, this));
|
||||
}
|
||||
},
|
||||
|
||||
_pointerMoveHandler: function(e) {
|
||||
var originalEvent = e.originalEvent;
|
||||
|
||||
if (this._thresholdExceeded(originalEvent)) {
|
||||
this._moveEvent = true;
|
||||
this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
|
||||
if (this._isVerticalDirection(originalEvent.clientX, originalEvent.clientY)) {
|
||||
this._toggleAppBarState(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_pointerUpHandler: function(e) {
|
||||
this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
|
||||
|
||||
var $appBar = this.root._$viewPort.find(".dx-app-bar");
|
||||
|
||||
if (e.originalEvent.button === 2) {
|
||||
this._toggleAppBarState();
|
||||
} else if (!this._moveEvent && $appBar[0] && !$appBar[0].contains(e.target)) {
|
||||
this._toggleAppBarState(false);
|
||||
}
|
||||
|
||||
this._moveEvent = false;
|
||||
},
|
||||
|
||||
_keyDownHandler: function(e) {
|
||||
if (e.keyCode === KEYCODE_WIN) {
|
||||
this._winKeyPressed = true;
|
||||
}
|
||||
},
|
||||
|
||||
_keyUpHandler: function(e) {
|
||||
if (this._winKeyPressed && (e.keyCode === KEYCODE_Z)) {
|
||||
this._toggleAppBarState();
|
||||
} else if (e.keyCode === KEYCODE_WIN) {
|
||||
this._winKeyPressed = false;
|
||||
}
|
||||
},
|
||||
|
||||
_toggleAppBarState: function(state) {
|
||||
if (!this.root._appBarHasCommands()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.root._$viewPort.find(".dx-app-bar").toggleClass("dx-app-bar-visible", !this._appBarBehavior || state);
|
||||
},
|
||||
|
||||
_isVerticalDirection: function(x, y) {
|
||||
return Math.abs(y - this._startTouchPoint.y) > Math.abs(x - this._startTouchPoint.x);
|
||||
},
|
||||
|
||||
_isTouch: function(event) {
|
||||
return event.pointerType === event.MSPOINTER_TYPE_TOUCH ||
|
||||
event.pointerType === event.MSPOINTER_TYPE_PEN;
|
||||
},
|
||||
|
||||
_startedInAppBarArea: function(event) {
|
||||
return (this.root._$viewPort.height() - APPBAR_TOUCH_AREA_HEIGHT) < event.clientY;
|
||||
},
|
||||
|
||||
_thresholdExceeded: function(originalEvent) {
|
||||
return originalEvent.clientY < (this._startTouchPoint.y - APPBAR_TOUCH_THRESHOLD);
|
||||
}
|
||||
});
|
||||
|
||||
var MultipaneLayoutController = DefaultLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "split";
|
||||
this._detailPaneName = options.detailPaneName || "detail";
|
||||
this._masterPaneName = options.masterPaneName || "master";
|
||||
options.defaultPaneName = this._detailPaneName;
|
||||
this.callBase(options);
|
||||
this._panesConfig = options.panesConfig;
|
||||
this._activeViews = {};
|
||||
this._stateStorageKey = "dxSplitLayoutState"
|
||||
}, init: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
this._router = options.app && options.app.router;
|
||||
this._onNavigatingHandler = $.proxy(this._onNavigating, this);
|
||||
this._onNavigatedHandler = $.proxy(this._onNavigated, this);
|
||||
this._navigationManager = options.navigationManager;
|
||||
this._ensurePanesConfig();
|
||||
this._initChildControllers(options)
|
||||
}, activate: function() {
|
||||
var tasks = [];
|
||||
this.callBase();
|
||||
this._navigationManager.on("navigating", this._onNavigatingHandler);
|
||||
this._navigationManager.on("navigated", this._onNavigatedHandler);
|
||||
this._navigationManager.on("navigatingBack", this._onNavigatingBackHandler);
|
||||
$.each(this._panesConfig, function(_, paneConfig) {
|
||||
tasks.push(paneConfig.controller.activate())
|
||||
});
|
||||
return $.when.apply($, tasks)
|
||||
}, deactivate: function() {
|
||||
var that = this,
|
||||
tasks = [];
|
||||
$.each(this._panesConfig, function(_, paneConfig) {
|
||||
tasks.push(paneConfig.controller.deactivate())
|
||||
});
|
||||
this._navigationManager.off("navigating", this._onNavigatingHandler);
|
||||
this._navigationManager.off("navigated", this._onNavigatedHandler);
|
||||
this.callBase();
|
||||
return $.when.apply($, tasks).done(function() {
|
||||
that._activeViews = {}
|
||||
})
|
||||
}, showView: function(viewInfo, direction) {
|
||||
var that = this,
|
||||
paneConfig = that._getPaneConfig(viewInfo);
|
||||
return paneConfig.controller.showView(viewInfo, direction).done(function() {
|
||||
that._activeViews[that._getViewPaneName(viewInfo.viewTemplateInfo)] = viewInfo
|
||||
})
|
||||
}, activeViewInfo: function() {
|
||||
return this._activeViews[this._masterPaneName]
|
||||
}, _updateLayoutTitle: function(viewInfo, defaultTitle) {
|
||||
if (this._getViewPaneName(viewInfo.viewTemplateInfo) === this._masterPaneName) {
|
||||
var title;
|
||||
if (viewInfo.model !== undefined) {
|
||||
title = ko.utils.unwrapObservable(viewInfo.model.title)
|
||||
}
|
||||
else {
|
||||
title = (viewInfo.viewTemplateInfo || {}).title
|
||||
}
|
||||
this._layoutModel.title(title || defaultTitle || "")
|
||||
}
|
||||
}, _ensurePanesConfig: function() {
|
||||
if (!this._panesConfig) {
|
||||
this._panesConfig = this._createPanesConfig()
|
||||
}
|
||||
}, _createPanesConfig: function() {
|
||||
return {}
|
||||
}, _initChildControllers: function(options) {
|
||||
var that = this;
|
||||
$.each(that._panesConfig, function(_, paneConfig) {
|
||||
var controller = paneConfig.controller;
|
||||
controller.init($.extend({}, options, {$viewPort: that._$mainLayout.find(paneConfig.selector)}));
|
||||
$.each(["viewRendered", "viewShowing", "viewReleased", "viewHidden"], function(_, callbacksPropertyName) {
|
||||
controller.on(callbacksPropertyName, function(args) {
|
||||
that.fireEvent(callbacksPropertyName, [args])
|
||||
})
|
||||
})
|
||||
})
|
||||
}, _onNavigating: function(args) {
|
||||
var options = args.options,
|
||||
$sourceElement = this._getEventSourceElement(args.options.jQueryEvent);
|
||||
var routeValues = this._router.parse(args.uri),
|
||||
viewTemplateInfo = this._viewEngine.getViewTemplateInfo(routeValues.view).option(),
|
||||
pane = this._getViewPaneName(viewTemplateInfo);
|
||||
if (pane === this._detailPaneName) {
|
||||
options.stack = this._detailPaneName + "_pane";
|
||||
options.root = options.root === undefined ? $sourceElement.is(this._panesConfig[this._masterPaneName].selector + " *") : options.root;
|
||||
options.keepPositionInStack = false
|
||||
}
|
||||
else {
|
||||
options.stack = options.stack || this._masterPaneCurrentStackKey
|
||||
}
|
||||
args.options.pane = pane
|
||||
}, _onNavigated: function(args) {
|
||||
if (args.options.pane === this._masterPaneName) {
|
||||
this._masterPaneCurrentStackKey = this._navigationManager.currentStackKey
|
||||
}
|
||||
}, _getEventSourceElement: function(jQueryEvent) {
|
||||
return jQueryEvent ? $(jQueryEvent.target) : $()
|
||||
}, _getPaneConfig: function(viewInfo) {
|
||||
return this._panesConfig[this._getViewPaneName(viewInfo.viewTemplateInfo)]
|
||||
}, _getViewPaneName: function(viewTemplateInfo) {
|
||||
return viewTemplateInfo.pane || this._detailPaneName
|
||||
}, _raiseEvent: function(callback) {
|
||||
callback.fire()
|
||||
}, _ensureChildController: function(controller, layoutName) {
|
||||
if (!controller) {
|
||||
throw new Error(layoutName + "Controller is not found but it is required by the '" + this.name + "' layout for specified platform and device. Make sure the " + layoutName + ".* files are referenced in your main *.html file or specify other platform and device.");
|
||||
}
|
||||
}, saveState: function(storage) {
|
||||
var state = {};
|
||||
$.each(this._activeViews, function(pane, viewInfo) {
|
||||
state[pane] = {
|
||||
uri: viewInfo.uri, stack: viewInfo.navigateOptions.stack
|
||||
}
|
||||
});
|
||||
var json = JSON.stringify(state);
|
||||
storage.setItem(this._stateStorageKey, json)
|
||||
}, restoreState: function(storage) {
|
||||
var json = storage.getItem(this._stateStorageKey);
|
||||
if (json) {
|
||||
try {
|
||||
var that = this,
|
||||
state = JSON.parse(json);
|
||||
$.each(state, function(pane, navigateOptions) {
|
||||
that._navigationManager.navigate(navigateOptions.uri, {
|
||||
stack: navigateOptions.stack, target: 'current'
|
||||
})
|
||||
})
|
||||
}
|
||||
catch(e) {
|
||||
this.removeState(storage);
|
||||
throw errors.Error("E3007");
|
||||
}
|
||||
}
|
||||
}, removeState: function(storage) {
|
||||
storage.removeItem(this._stateStorageKey)
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.name = options.name || "split";
|
||||
this._detailPaneName = options.detailPaneName || "detail";
|
||||
this._masterPaneName = options.masterPaneName || "master";
|
||||
options.defaultPaneName = this._detailPaneName;
|
||||
this.callBase(options);
|
||||
this._panesConfig = options.panesConfig;
|
||||
this._activeViews = {};
|
||||
this._stateStorageKey = "dxSplitLayoutState";
|
||||
},
|
||||
|
||||
init: function(options) {
|
||||
options = options || {};
|
||||
this.callBase(options);
|
||||
this._router = options.app && options.app.router;
|
||||
this._onNavigatingHandler = $.proxy(this._onNavigating, this);
|
||||
this._onNavigatedHandler = $.proxy(this._onNavigated, this);
|
||||
this._navigationManager = options.navigationManager;
|
||||
this._ensurePanesConfig();
|
||||
this._initChildControllers(options);
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
var tasks = [];
|
||||
|
||||
this.callBase();
|
||||
this._navigationManager.on("navigating", this._onNavigatingHandler);
|
||||
this._navigationManager.on("navigated", this._onNavigatedHandler);
|
||||
this._navigationManager.on("navigatingBack", this._onNavigatingBackHandler);
|
||||
$.each(this._panesConfig, function(_, paneConfig) {
|
||||
tasks.push(paneConfig.controller.activate());
|
||||
});
|
||||
|
||||
return $.when.apply($, tasks);
|
||||
},
|
||||
|
||||
deactivate: function() {
|
||||
var that = this,
|
||||
tasks = [];
|
||||
|
||||
$.each(this._panesConfig, function(_, paneConfig) {
|
||||
tasks.push(paneConfig.controller.deactivate());
|
||||
});
|
||||
|
||||
this._navigationManager.off("navigating", this._onNavigatingHandler);
|
||||
this._navigationManager.off("navigated", this._onNavigatedHandler);
|
||||
|
||||
this.callBase();
|
||||
|
||||
return $.when.apply($, tasks).done(function() {
|
||||
that._activeViews = {};
|
||||
});
|
||||
},
|
||||
|
||||
showView: function(viewInfo, direction) {
|
||||
var that = this,
|
||||
paneConfig = that._getPaneConfig(viewInfo);
|
||||
|
||||
var paneName = that._getViewPaneName(viewInfo.viewTemplateInfo);
|
||||
if (!this._masterPaneCurrentStackKey && paneName === this._masterPaneName) {
|
||||
this._masterPaneCurrentStackKey = viewInfo.navigateOptions.stack;
|
||||
}
|
||||
|
||||
return paneConfig.controller.showView(viewInfo, direction).done(function() {
|
||||
that._activeViews[that._getViewPaneName(viewInfo.viewTemplateInfo)] = viewInfo;
|
||||
});
|
||||
},
|
||||
|
||||
activeViewInfo: function() {
|
||||
return this._activeViews[this._masterPaneName];
|
||||
},
|
||||
|
||||
_updateLayoutTitle: function(viewInfo, defaultTitle) {
|
||||
if (this._getViewPaneName(viewInfo.viewTemplateInfo) === this._masterPaneName) {
|
||||
var title;
|
||||
if (viewInfo.model !== undefined) {
|
||||
title = ko.utils.unwrapObservable(viewInfo.model.title);
|
||||
} else {
|
||||
title = (viewInfo.viewTemplateInfo || {}).title;
|
||||
}
|
||||
});
|
||||
var IOSSplitLayoutController = MultipaneLayoutController.inherit({_createPanesConfig: function() {
|
||||
this._ensureChildController(SimpleLayoutControllerModule.SimpleLayoutController, "SimpleLayout");
|
||||
return {
|
||||
master: {
|
||||
controller: new SimpleLayoutControllerModule.SimpleLayoutController, selector: ".master-pane"
|
||||
}, detail: {
|
||||
controller: new SimpleLayoutControllerModule.SimpleLayoutController, selector: ".detail-pane"
|
||||
}
|
||||
}
|
||||
}});
|
||||
var ToolbarController = Class.inherit({
|
||||
ctor: function($toolbar, commandManager) {
|
||||
this._commandManager = commandManager;
|
||||
this._$toolbar = $toolbar;
|
||||
this._toolbar = $toolbar.dxToolbar("instance");
|
||||
this._commandContainer = $toolbar.dxCommandContainer("instance")
|
||||
}, showViews: function(viewInfos) {
|
||||
|
||||
this._layoutModel.title(title || defaultTitle || "");
|
||||
}
|
||||
},
|
||||
|
||||
_ensurePanesConfig: function() {
|
||||
if (!this._panesConfig) {
|
||||
this._panesConfig = this._createPanesConfig();
|
||||
}
|
||||
},
|
||||
|
||||
_createPanesConfig: function() {
|
||||
return {};
|
||||
},
|
||||
|
||||
_initChildControllers: function(options) {
|
||||
var that = this;
|
||||
$.each(that._panesConfig, function(_, paneConfig) {
|
||||
var controller = paneConfig.controller;
|
||||
controller.init($.extend({}, options, {
|
||||
$viewPort: that._$mainLayout.find(paneConfig.selector)
|
||||
}));
|
||||
|
||||
$.each(["viewRendered", "viewShowing", "viewReleased", "viewHidden"], function(_, callbacksPropertyName) {
|
||||
controller.on(callbacksPropertyName, function(args) {
|
||||
that.fireEvent(callbacksPropertyName, [args]);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_onNavigating: function(args) {
|
||||
var options = args.options,
|
||||
$sourceElement = this._getEventSourceElement(args.options.jQueryEvent);
|
||||
|
||||
var routeValues = this._router.parse(args.uri),
|
||||
viewTemplateInfo = this._viewEngine.getViewTemplateInfo(routeValues.view).option(),
|
||||
pane = this._getViewPaneName(viewTemplateInfo);
|
||||
|
||||
if (pane === this._detailPaneName) {
|
||||
options.stack = this._detailPaneName + "_pane";
|
||||
options.root = options.root === undefined ? $sourceElement.is(this._panesConfig[this._masterPaneName].selector + " *") : options.root;
|
||||
options.keepPositionInStack = false;
|
||||
} else {
|
||||
options.stack = options.stack || this._masterPaneCurrentStackKey;
|
||||
}
|
||||
args.options.pane = pane;
|
||||
},
|
||||
|
||||
_onNavigated: function(args) {
|
||||
if (args.options.pane === this._masterPaneName) {
|
||||
this._masterPaneCurrentStackKey = this._navigationManager.currentStackKey;
|
||||
}
|
||||
},
|
||||
|
||||
_getEventSourceElement: function(jQueryEvent) {
|
||||
return jQueryEvent ? $(jQueryEvent.target) : $();
|
||||
},
|
||||
|
||||
_getPaneConfig: function(viewInfo) {
|
||||
return this._panesConfig[this._getViewPaneName(viewInfo.viewTemplateInfo)];
|
||||
},
|
||||
|
||||
_getViewPaneName: function(viewTemplateInfo) {
|
||||
return viewTemplateInfo.pane || this._detailPaneName;
|
||||
},
|
||||
|
||||
_raiseEvent: function(callback) {
|
||||
callback.fire();
|
||||
},
|
||||
|
||||
_ensureChildController: function(controller, layoutName) {
|
||||
if (!controller) {
|
||||
throw new Error(layoutName + "Controller is not found but it is required by the '" + this.name + "' layout for specified platform and device. Make sure the " + layoutName + ".* files are referenced in your main *.html file or specify other platform and device.");
|
||||
}
|
||||
},
|
||||
|
||||
saveState: function(storage) {
|
||||
var state = {};
|
||||
|
||||
$.each(this._activeViews, function(pane, viewInfo) {
|
||||
state[pane] = {
|
||||
uri: viewInfo.uri,
|
||||
stack: viewInfo.navigateOptions.stack
|
||||
};
|
||||
});
|
||||
|
||||
var json = JSON.stringify(state);
|
||||
storage.setItem(this._stateStorageKey, json);
|
||||
},
|
||||
|
||||
restoreState: function(storage) {
|
||||
var json = storage.getItem(this._stateStorageKey);
|
||||
if (json) {
|
||||
try {
|
||||
var that = this,
|
||||
commands = this._mergeCommands(viewInfos),
|
||||
toolbarItems = that._toolbar.option("items");
|
||||
var newItems = $.map(toolbarItems, function(item) {
|
||||
return item.command ? undefined : item
|
||||
state = JSON.parse(json);
|
||||
|
||||
$.each(state, function(pane, navigateOptions) {
|
||||
that._navigationManager.navigate(navigateOptions.uri, {
|
||||
stack: navigateOptions.stack,
|
||||
target: 'current'
|
||||
});
|
||||
that._toolbar.option("items", newItems);
|
||||
fx.off = true;
|
||||
that._commandManager.renderCommandsToContainers(commands, [that._commandContainer]);
|
||||
fx.off = false
|
||||
}, _mergeCommands: function(viewInfos) {
|
||||
var result = [],
|
||||
idHash = {};
|
||||
$.each(viewInfos, function(_, viewInfo) {
|
||||
if (viewInfo.commands) {
|
||||
$.each(viewInfo.commands, function(_, command) {
|
||||
var id = command.option("id");
|
||||
if (!(id in idHash)) {
|
||||
idHash[id] = true;
|
||||
result.push(command)
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch (e) {
|
||||
this.removeState(storage);
|
||||
throw errors.Error("E3007");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
removeState: function(storage) {
|
||||
storage.removeItem(this._stateStorageKey);
|
||||
}
|
||||
});
|
||||
|
||||
var IOSSplitLayoutController = MultipaneLayoutController.inherit({
|
||||
|
||||
_createPanesConfig: function() {
|
||||
|
||||
|
||||
return {
|
||||
master: {
|
||||
controller: new SimpleLayoutControllerModule.SimpleLayoutController(),
|
||||
selector: ".master-pane"
|
||||
},
|
||||
detail: {
|
||||
controller: new SimpleLayoutControllerModule.SimpleLayoutController(),
|
||||
selector: ".detail-pane"
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var ToolbarController = Class.inherit({
|
||||
ctor: function($toolbar, commandManager) {
|
||||
this._commandManager = commandManager;
|
||||
this._$toolbar = $toolbar;
|
||||
this._toolbar = $toolbar.dxToolbar("instance");
|
||||
this._commandContainer = $toolbar.dxCommandContainer("instance");
|
||||
},
|
||||
|
||||
showViews: function(viewInfos) {
|
||||
var that = this,
|
||||
commands = this._mergeCommands(viewInfos),
|
||||
toolbarItems = that._toolbar.option("items");
|
||||
|
||||
var newItems = $.map(toolbarItems, function(item) {
|
||||
return item.command ? undefined : item;
|
||||
});
|
||||
that._toolbar.option("items", newItems);
|
||||
|
||||
fx.off = true;
|
||||
that._commandManager.renderCommandsToContainers(commands, [that._commandContainer]);
|
||||
fx.off = false;
|
||||
},
|
||||
|
||||
_mergeCommands: function(viewInfos) {
|
||||
var result = [],
|
||||
idHash = {};
|
||||
|
||||
$.each(viewInfos, function(_, viewInfo) {
|
||||
if (viewInfo.commands) {
|
||||
$.each(viewInfo.commands, function(_, command) {
|
||||
var id = command.option("id");
|
||||
if (!(id in idHash)) {
|
||||
idHash[id] = true;
|
||||
result.push(command);
|
||||
}
|
||||
});
|
||||
return result
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var AndroidSplitLayoutController = MultipaneLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.layoutModel = options.layoutModel || this._createLayoutModel();
|
||||
this.callBase(options)
|
||||
}, init: function(options) {
|
||||
this.callBase(options);
|
||||
this.toolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager)
|
||||
}, _createLayoutModel: function() {
|
||||
return {title: ko.observable("")}
|
||||
}, showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
that._updateLayoutTitle(viewInfo);
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.toolbarController.showViews(that._activeViews)
|
||||
})
|
||||
}, _createPanesConfig: function() {
|
||||
this._ensureChildController(EmptyLayoutControllerModule.EmptyLayoutController, "EmptyLayout");
|
||||
return {
|
||||
master: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".master-pane"
|
||||
}, detail: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".detail-pane"
|
||||
}
|
||||
}
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
options.layoutModel = options.layoutModel || this._createLayoutModel();
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this.toolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager);
|
||||
},
|
||||
|
||||
_createLayoutModel: function() {
|
||||
return {
|
||||
title: ko.observable("")
|
||||
};
|
||||
},
|
||||
|
||||
showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
|
||||
that._updateLayoutTitle(viewInfo);
|
||||
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.toolbarController.showViews(that._activeViews);
|
||||
});
|
||||
},
|
||||
|
||||
_createPanesConfig: function() {
|
||||
|
||||
|
||||
return {
|
||||
master: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController(),
|
||||
selector: ".master-pane"
|
||||
},
|
||||
detail: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController(),
|
||||
selector: ".detail-pane"
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var WinSplitLayoutController = MultipaneLayoutController.inherit({
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
this._eventHelper = new SplitLayoutEventHelper(this);
|
||||
options.layoutModel = options.layoutModel || this._createLayoutModel();
|
||||
this.callBase(options)
|
||||
}, init: function(options) {
|
||||
this.callBase(options);
|
||||
this._eventHelper.init();
|
||||
this.headerToolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager)
|
||||
}, showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
that._updateLayoutTitle(viewInfo);
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.headerToolbarController.showViews(that._activeViews)
|
||||
})
|
||||
}, _createLayoutModel: function() {
|
||||
return {title: ko.observable("")}
|
||||
}, _createPanesConfig: function() {
|
||||
this._ensureChildController(EmptyLayoutControllerModule.EmptyLayoutController, "EmptyLayout");
|
||||
return {
|
||||
master: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".left-content"
|
||||
}, detail: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".right-content"
|
||||
}
|
||||
}
|
||||
}, _appBarHasCommands: function() {
|
||||
var footerToolbar = this._$viewPort.find(".footer-toolbar").data("dxToolbar");
|
||||
return footerToolbar ? footerToolbar.option("items").length : false
|
||||
ctor: function(options) {
|
||||
options = options || {};
|
||||
this._eventHelper = new SplitLayoutEventHelper(this);
|
||||
options.layoutModel = options.layoutModel || this._createLayoutModel();
|
||||
this.callBase(options);
|
||||
},
|
||||
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this._eventHelper.init();
|
||||
this.headerToolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager);
|
||||
},
|
||||
|
||||
showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
|
||||
that._updateLayoutTitle(viewInfo);
|
||||
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.headerToolbarController.showViews(that._activeViews);
|
||||
});
|
||||
},
|
||||
|
||||
_createLayoutModel: function() {
|
||||
return {
|
||||
title: ko.observable("")
|
||||
};
|
||||
},
|
||||
|
||||
_createPanesConfig: function() {
|
||||
|
||||
|
||||
return {
|
||||
master: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController(),
|
||||
selector: ".left-content"
|
||||
},
|
||||
detail: {
|
||||
controller: new EmptyLayoutControllerModule.EmptyLayoutController(),
|
||||
selector: ".right-content"
|
||||
}
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
_appBarHasCommands: function() {
|
||||
var footerToolbar = this._$viewPort.find(".footer-toolbar").data("dxToolbar");
|
||||
return footerToolbar ? footerToolbar.option("items").length : false;
|
||||
}
|
||||
});
|
||||
|
||||
var Win8SplitLayoutController = WinSplitLayoutController.inherit({
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this.footerToolbarController = new ToolbarController(this._$mainLayout.find(".footer-toolbar"), this._commandManager)
|
||||
}, showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.footerToolbarController.showViews(that._activeViews)
|
||||
})
|
||||
}
|
||||
});
|
||||
init: function(options) {
|
||||
this.callBase(options);
|
||||
this.footerToolbarController = new ToolbarController(this._$mainLayout.find(".footer-toolbar"), this._commandManager);
|
||||
},
|
||||
|
||||
showView: function(viewInfo, direction) {
|
||||
var that = this;
|
||||
|
||||
return that.callBase(viewInfo, direction).done(function() {
|
||||
that.footerToolbarController.showViews(that._activeViews);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
layoutSets["split"] = layoutSets["split"] || [];
|
||||
layoutSets["split"].push({
|
||||
platform: "ios", tablet: true, controller: new IOSSplitLayoutController
|
||||
platform: "ios",
|
||||
tablet: true,
|
||||
controller: new IOSSplitLayoutController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "android", tablet: true, controller: new AndroidSplitLayoutController
|
||||
platform: "android",
|
||||
tablet: true,
|
||||
controller: new AndroidSplitLayoutController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "generic", tablet: true, controller: new IOSSplitLayoutController
|
||||
platform: "generic",
|
||||
tablet: true,
|
||||
controller: new IOSSplitLayoutController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "win", phone: false, controller: new WinSplitLayoutController
|
||||
platform: "win",
|
||||
phone: false,
|
||||
controller: new WinSplitLayoutController()
|
||||
});
|
||||
layoutSets["split"].push({
|
||||
platform: "win", version: [8], phone: false, controller: new Win8SplitLayoutController
|
||||
platform: "win",
|
||||
version: [8],
|
||||
phone: false,
|
||||
controller: new Win8SplitLayoutController()
|
||||
});
|
||||
|
||||
exports.MultipaneLayoutController = MultipaneLayoutController;
|
||||
exports.IOSSplitLayoutController = IOSSplitLayoutController;
|
||||
exports.ToolbarController = ToolbarController;
|
||||
exports.AndroidSplitLayoutController = AndroidSplitLayoutController;
|
||||
exports.WinSplitLayoutController = WinSplitLayoutController;
|
||||
exports.Win8SplitLayoutController = Win8SplitLayoutController;
|
||||
return exports
|
||||
|
||||
return exports;
|
||||
|
||||
}));
|
||||
Reference in New Issue
Block a user