alloy-widget-nl.fokkezb.drawer
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -57,2 +57,31 @@ var args = arguments[0] || {}; | ||
//transform properties | ||
if (mod === 'dk.napp.drawer') { | ||
if (_.has(args, 'drawerIndicatorEnabled')) { | ||
args.hamburgerIcon = args.drawerIndicatorEnabled; | ||
delete args.drawerIndicatorEnabled; | ||
} | ||
if (_.has(args, 'drawerArrowIcon')) { | ||
args.arrowAnimation = args.drawerArrowIcon; | ||
delete args.drawerArrowIcon; | ||
} | ||
if (_.has(args, 'drawerArrowIconColor')) { | ||
args.hamburgerIconColor = args.drawerArrowIconColor; | ||
delete args.drawerArrowIconColor; | ||
} | ||
} else { | ||
if (_.has(args, 'hamburgerIcon')) { | ||
args.drawerIndicatorEnabled = args.hamburgerIcon; | ||
delete args.hamburgerIcon; | ||
} | ||
if (_.has(args, 'arrowAnimation')) { | ||
args.drawerArrowIcon = args.arrowAnimation; | ||
delete args.arrowAnimation; | ||
} | ||
if (_.has(args, 'hamburgerIconColor')) { | ||
args.drawerArrowIconColor = args.hamburgerIconColor; | ||
delete args.hamburgerIconColor; | ||
} | ||
} | ||
// delete irrelevant args | ||
@@ -63,26 +92,36 @@ delete args.id; | ||
// create actual drawer | ||
$.instance = $.module.createDrawer(_.omit(args, 'window')); | ||
if (mod === 'dk.napp.drawer') { | ||
if (mod === 'dk.napp.drawer') { | ||
_.extend(args, args.window || {}); | ||
// create actual drawer | ||
$.instance = $.module.createDrawer(_.omit(args, 'window')); | ||
$.window = $.instance; | ||
$.addTopLevelView($.instance); | ||
} else { | ||
$.window = Ti.UI.createWindow(_.defaults(args.window || {}, { | ||
backgroundColor: 'white' | ||
})); | ||
// create actual drawer | ||
$.instance = $.module.createDrawer(_.omit(args, 'window')); | ||
$.window = Ti.UI.createWindow(_.extend(_.pick(args, ["orientationModes", "exitOnClose", "backgroundColor"]), args.window || {})); | ||
$.window.add($.instance); | ||
$.addTopLevelView($.window); | ||
} | ||
if (OS_ANDROID) { | ||
$.window.addEventListener('open', function (e) { | ||
var actionBar = e.source.activity.actionBar; | ||
var actionBar = (mod === 'dk.napp.drawer' ? this : e.source).getActivity().getActionBar(); | ||
if (actionBar) { | ||
actionBar.displayHomeAsUp = true; | ||
actionBar.onHomeIconItemSelected = function () { | ||
$.instance.toggleLeftWindow(); | ||
}; | ||
actionBar.setDisplayHomeAsUp(true); | ||
actionBar.setOnHomeIconItemSelected(function () { | ||
if ($.isRightWindowOpen()) { | ||
return $.closeRightWindow(); | ||
} | ||
$.toggleLeftWindow(); | ||
}); | ||
} | ||
}); | ||
$.addTopLevelView($.window); | ||
} | ||
@@ -110,4 +149,6 @@ | ||
'parallaxAmount', | ||
'statusBarStyle' | ||
'statusBarStyle', | ||
'hamburgerIcon', | ||
'hamburgerIconColor', | ||
'arrowAnimation' | ||
]; | ||
@@ -197,2 +238,14 @@ } else { | ||
$.drawerIndicatorEnabled = $.hamburgerIcon; | ||
$.setDrawerIndicatorEnabled = $.setHamburgerIcon; | ||
$.getDrawerIndicatorEnabled = $.getHamburgerIcon; | ||
$.drawerArrowIcon = $.arrowAnimation; | ||
$.setDrawerArrowIcon = $.setArrowAnimation; | ||
$.getDrawerArrowIcon = $.getArrowAnimation; | ||
$.drawerArrowIconColor = $.hamburgerIconColor; | ||
$.setDrawerArrowIconColor = $.setHamburgerIconColor; | ||
$.getDrawerArrowIconColor = $.getHamburgerIconColor; | ||
} else { | ||
@@ -209,11 +262,11 @@ | ||
$.isAnyWindowOpen = function () { | ||
return $.instance.isLeftDrawerOpen() || $.instance.isRightDrawerOpen(); | ||
return $.instance.getIsLeftDrawerOpen() || $.instance.getIsRightDrawerOpen(); | ||
}; | ||
$.isLeftWindowOpen = function () { | ||
return $.instance.isLeftDrawerOpen(); | ||
return $.instance.getIsLeftDrawerOpen(); | ||
}; | ||
$.isRightWindowOpen = function () { | ||
return $.instance.isRightDrawerOpen(); | ||
return $.instance.getIsRightDrawerOpen(); | ||
}; | ||
@@ -232,2 +285,14 @@ | ||
$.getRightWindow = $.getRightView; | ||
$.hamburgerIcon = $.drawerIndicatorEnabled; | ||
$.setHamburgerIcon = $.setDrawerIndicatorEnabled; | ||
$.getHamburgerIcon = $.getDrawerIndicatorEnabled; | ||
$.arrowAnimation = $.drawerArrowIcon; | ||
$.setArrowAnimation = $.setDrawerArrowIcon; | ||
$.getArrowAnimation = $.getDrawerArrowIcon; | ||
$.hamburgerIconColor = $.drawerArrowIconColor; | ||
$.setHamburgerIconColor = $.setDrawerArrowIconColor; | ||
$.getHamburgerIconColor = $.getDrawerArrowIconColor; | ||
} | ||
@@ -234,0 +299,0 @@ |
{ | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "An Alloy widget wrapping the NappDrawer and DrawerLayout module for Facebook-like sliding side menus.", | ||
@@ -13,14 +13,27 @@ "author": "Fokke Zandbergen", | ||
"package.json" | ||
] | ||
], | ||
"config": { | ||
"nl.fokkezb.drawer": "1.1.2" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/fokkezb/nl.fokkezb.drawer.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/fokkezb/nl.fokkezb.drawer/issues" | ||
}, | ||
"homepage": "https://github.com/fokkezb/nl.fokkezb.drawer#readme", | ||
"keywords": [ | ||
"slide", | ||
"alloy", | ||
"alloy-widget", | ||
"appc-npm", | ||
"appcelerator", | ||
"drawer", | ||
"nappdrawer", | ||
"drawerlayout", | ||
"facebook", | ||
"menu", | ||
"nappdrawer", | ||
"side", | ||
"appc-npm", | ||
"alloy-widget" | ||
"slide" | ||
], | ||
@@ -27,0 +40,0 @@ "scripts": { |
@@ -6,3 +6,3 @@ { | ||
"author": "Fokke Zandbergen", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"copyright":"Copyright (c) 2015", | ||
@@ -9,0 +9,0 @@ "license":"Apache License, Version 2.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
18602
299
1
0
1