click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r780751 - in /incubator/click/trunk/click/extras/src: META-INF/web/click/calendar/calendar_date_select.js org/apache/click/extras/control/DateField.java
Date Mon, 01 Jun 2009 17:50:31 GMT
Author: sabob
Date: Mon Jun  1 17:50:31 2009
New Revision: 780751

URL: http://svn.apache.org/viewvc?rev=780751&view=rev
Log:
disabled Calendar footer and conditionally render buttons based on whether time is shown

Modified:
    incubator/click/trunk/click/extras/src/META-INF/web/click/calendar/calendar_date_select.js
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java

Modified: incubator/click/trunk/click/extras/src/META-INF/web/click/calendar/calendar_date_select.js
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/META-INF/web/click/calendar/calendar_date_select.js?rev=780751&r1=780750&r2=780751&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/META-INF/web/click/calendar/calendar_date_select.js
(original)
+++ incubator/click/trunk/click/extras/src/META-INF/web/click/calendar/calendar_date_select.js
Mon Jun  1 17:50:31 2009
@@ -101,6 +101,7 @@
       popup: nil,
       formatValue: 'yyyy MMM dd',
       time: false,
+      footer: true,
       buttons: true,
       clear_button: true,
       year_range: 10,
@@ -158,6 +159,7 @@
     this.initHeaderDiv();
     this.initButtonsDiv();
     this.initCalendarGrid();
+    this.initFooterDiv();
     this.updateFooter(" ");
     
     this.refresh();
@@ -264,6 +266,12 @@
       }
     }
   },
+  initFooterDiv: function(){
+    if (!this.options.get("footer")) {
+      var footer_div = this.footer_div;
+      if(footer_div) footer_div.remove();
+    }
+  },
   refresh: function ()
   {
     this.refreshMonthYear();
@@ -362,7 +370,14 @@
     this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false;
     this.date.setDate(1);
   },
-  updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren();
this.footer_div.build("span", {innerHTML: text }); },
+  updateFooter:function(text) {
+    if (this.options.get("footer")) {
+      if (!text)
+        text = this.dateString();
+      this.footer_div.purgeChildren();
+      this.footer_div.build("span", {innerHTML: text });
+    }
+  },
   clearDate:function() {
     if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup")
!= "force") return false;
     var last_value = this.target_element.value;

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java?rev=780751&r1=780750&r2=780751&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
(original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
Mon Jun  1 17:50:31 2009
@@ -835,6 +835,8 @@
             buffer.append(" calendar = new CalendarDateSelect($('").append(fieldId).append("'),
{");
             buffer.append("  minute_interval: 1, popup_by: '").append(imgId).append("',");
             buffer.append("  embedded: false,");
+            buffer.append("  footer: false,");
+            buffer.append("  buttons: ").append(isShowTime()).append(",");
             buffer.append("  time: ").append(isShowTime() ? "'mixed'," : "false,");
             buffer.append("  formatValue: '").append(getCalendarPattern()).append("',");
             buffer.append("  year_range: [").append(getMinimumYear()).append(",").append(getMaximumYear()).append("]");



Mime
View raw message