[Svn-src-all:3259] [version-2_12-multilang 22160] #1987 データの削除を可能にする。

yomoro admin @ mail.ec-cube.net
2012年 12月 26日 (水) 19:11:39 JST


Subversion committed to /home/svn/open 22160
http://svn.ec-cube.net/open_trac/changeset/22160
┌────────────────────────────┐
│更新者 :  yomoro                                       │
│更新日時:  2012-12-26 19:11:39 +0900 (水, 26 12月 2012)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#1987 データの削除を可能にする。

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_12-multilang/html/js/jquery.ui/ui-datepicker.js

変更: branches/version-2_12-multilang/html/js/jquery.ui/ui-datepicker.js
===================================================================
--- branches/version-2_12-multilang/html/js/jquery.ui/ui-datepicker.js	2012-12-26 09:04:29 UTC (rev 22159)
+++ branches/version-2_12-multilang/html/js/jquery.ui/ui-datepicker.js	2012-12-26 10:11:39 UTC (rev 22160)
@@ -2,13 +2,10 @@
 	$.datepicker.setDefaults( $.datepicker.regional[ "ja" ] );
 	$( "#datepicker" ).datepicker({
 	beforeShowDay: function(date) {
-		//Sunday
 		if(date.getDay() == 0) {
-			return [true,"date-sunday"];
-		//Saturday   
+			return [true,"date-sunday"]; 
 		} else if(date.getDay() == 6){
 			return [true,"date-saturday"];
-		//day
 		} else {
 			return [true];
 		}
@@ -19,6 +16,28 @@
 		$("*[name=year]").val(dates[0]);
 		$("*[name=month]").val(dates[1]);
 		$("*[name=day]").val(dates[2]);
-	}
+	},
+	showButtonPanel: true,
+	beforeShow: showAdditionalButton,       
+	onChangeMonthYear: showAdditionalButton
 	});
-});
\ No newline at end of file
+});
+
+
+var showAdditionalButton = function (input) {
+	setTimeout(function () {
+		var buttonPane = $(input)
+				 .datepicker("widget")
+				 .find(".ui-datepicker-buttonpane");
+		var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">クリア</button>');
+		btn
+				.unbind("click")
+				.bind("click", function () {
+					$.datepicker._clearDate(input);
+					$("*[name=year]").val("");
+					$("*[name=month]").val("");
+					$("*[name=day]").val("");
+				});
+		btn.appendTo(buttonPane);
+	}, 1);
+};
\ No newline at end of file




Svn-src-all メーリングリストの案内