Permalink
Browse files

added a generic confirmation dialog and removed the customer delete one.

Also fixed up some random UI stuff
  • Loading branch information...
1 parent 9553fd3 commit eb328f67ccf8c13c11dd1e18481d2012863934b4 @jbass86 committed Dec 3, 2013
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -4,19 +4,20 @@
define(["vendor/backbone"]
-(Backbone, Math2) ->
+(Backbone) ->
customerDeleteDialogModel = Backbone.Model.extend(
-
###*
- * initialize a new model, will automatically initialize a new
- * search
* @method initialize
*
*###
initialize: (options) ->
- );
+ if (options.title)
+ @set("title", options.title);
+ else
+ @set("title", "Confirm Dialog");
+ );
);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,16 +1,16 @@
###
-CustomerSectionBarView
+ConfirmDialogView
@author Josh Bass
###
define(["vendor/backbone",
- "plugins/CustomerSection/view/Templates",
- 'css!plugins/CustomerSection/view/res/css/customerDeleteDialog.css'],
+ "plugins/ConfirmDialog/view/Templates",
+ 'css!plugins/ConfirmDialog/view/res/css/confirmDialog.css'],
(Backbone, Templates, CSS) ->
Backbone.View.extend(
- className: "customerDeleteDialog",
+ className: "confirmDialog",
events: {"click .dialogYes" : "confirm", \
"click .dialogNo" : "cancel"},
@@ -24,12 +24,10 @@ define(["vendor/backbone",
@method render
###
render: () ->
- @$el.html(Templates.customerDeleteDialog({}));
+ @$el.html(Templates.confirmDialog({}));
return @$el
###
- Called after Dialog has been appended, this will set up the prog search
- list with all known searches
@method realized
###
realized: () ->
@@ -38,9 +36,10 @@ define(["vendor/backbone",
@$el.find(".dialogNo").button();
- confirmDelete: (deleteAction) ->
+ confirmDelete: (confirmAction) ->
- @$el.dialog({title: "Customer Delete Confirm", \
+ @$el.dialog({hide: { effect: "explode", duration: 1000 }, \
+ title: @model.get("title"), \
close: () =>
console.log("I was closed...");
if (@model.get("actionConfirmed"))

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,15 @@
+
+ define(["vendor/handlebars"], function(Handlebars) {
+ return {
+
+"confirmDialog": Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [2,'>= 1.0.0-rc.3'];
+helpers = helpers || Handlebars.helpers; data = data || {};
+
+
+
+ return "<span>Do you wish to confirm this action?</span>\r\n\r\n<div class=\"buttonPanel\">\r\n <button id=\"button\" class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only dialogYes\" role=\"button\" aria-disabled=\"false\">\r\n Yes\r\n </button>\r\n <button id=\"button\" class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only dialogNo\" role=\"button\" aria-disabled=\"false\">\r\n No\r\n </button>\r\n</div>";
+ }
+
+)
+}});
@@ -1,14 +1,14 @@
-.customerDeleteDialog{
+.confirmDialog{
width: 200px;
height: 200px;
}
-.customerDeleteDialog span{
+.confirmDialog span{
text-align: center;
}
-.customerDeleteDialog .buttonPanel{
+.confirmDialog .buttonPanel{
padding-top: 20px;
text-align: center;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -5,13 +5,13 @@ CustomerSectionBarView
define(["vendor/backbone",
"plugins/CustomerSection/model/CustomerUpdatePanelModel",
"plugins/CustomerSection/view/CustomerUpdatePanelView",
- "plugins/CustomerSection/model/CustomerDeleteDialogModel",
- "plugins/CustomerSection/view/CustomerDeleteDialogView",
+ "plugins/ConfirmDialog/model/ConfirmDialogModel",
+ "plugins/ConfirmDialog/view/ConfirmDialogView",
"plugins/CustomerSection/view/Templates",
'css!plugins/CustomerSection/view/res/css/customerSection.css'],
(Backbone, CustomerUpdatePanelModel, CustomerUpdatePanelView,
- CustomerDeleteDialogModel, CustomerDeleteDialogView, Templates, CSS) ->
+ ConfirmDialogModel, ConfirmDialogView, Templates, CSS) ->
Backbone.View.extend(
@@ -29,8 +29,8 @@ define(["vendor/backbone",
@customerUpdateModel = new CustomerUpdatePanelModel({customerViewModel: @model});
@customerUpdateView = new CustomerUpdatePanelView({model: @customerUpdateModel});
- @customerDeleteDialogModel = new CustomerDeleteDialogModel();
- @customerDeleteDialogView = new CustomerDeleteDialogView({model: @customerDeleteDialogModel});
+ @customerDeleteDialogModel = new ConfirmDialogModel({title: "Customer Delete Confirm"});
+ @customerDeleteDialogView = new ConfirmDialogView({model: @customerDeleteDialogModel});
@model.on("change:customerEvent", ()=>
window.setTimeout(() =>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -2,16 +2,6 @@
define(["vendor/handlebars"], function(Handlebars) {
return {
-"customerDeleteDialog": Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [2,'>= 1.0.0-rc.3'];
-helpers = helpers || Handlebars.helpers; data = data || {};
-
-
-
- return "<span>Do you wish to confirm this action?</span>\r\n\r\n<div class=\"buttonPanel\">\r\n <button id=\"button\" class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only dialogYes\" role=\"button\" aria-disabled=\"false\">\r\n Yes\r\n </button>\r\n <button id=\"button\" class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only dialogNo\" role=\"button\" aria-disabled=\"false\">\r\n No\r\n </button>\r\n</div>";
- }
-
-),
"customerRowTemplate": Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [2,'>= 1.0.0-rc.3'];
helpers = helpers || Handlebars.helpers; data = data || {};
@@ -6,6 +6,8 @@
text-align: center;
display: block;
+
+ overflow-y: scroll;
/*background-image: linear-gradient(right bottom, rgb(4,18,54) 6%, rgb(99,111,122) 63%);
background-image: -o-linear-gradient(right bottom, rgb(4,18,54) 6%, rgb(99,111,122) 63%);
background-image: -moz-linear-gradient(right bottom, rgb(4,18,54) 6%, rgb(99,111,122) 63%);
@@ -24,7 +24,7 @@ a {
);
width: 100%;
- height: 40px;
+ height: 4%;
position: absolute;
top: 0px;
@@ -37,14 +37,17 @@ a {
/*background: red;*/
background-image:url('../images/background.jpg');
+ /*background-image:url('../images/black_fabric_background.jpg');*/
/*background-image:url('../images/cute_background.jpg');*/
background-size:100% 100%;
background-repeat:no-repeat;
position: absolute;
- top: 40px;
+ top: 4%;
left: 0px;
width: 100%;
- height: 100%;
+ height: 96%;
+
+ overflow: hidden;
}

0 comments on commit eb328f6

Please sign in to comment.