can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r10807: LJSUP-8956: New calendar widget for S2 s...

Committer: dpetrov
LJSUP-8956: New calendar widget for S2 style 'Minimalism'
U   trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js
Modified: trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js	2011-08-08 08:17:11 UTC (rev 10806)
+++ trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js	2011-08-08 08:36:51 UTC (rev 10807)
@@ -282,8 +282,17 @@
 		options: {}, //all options were move to the default options object
 
 		_create: function() {
-			this.options = jQuery.extend( true, {}, defaultOptions, this.options );
+			this._preInit();
+			this._init();
+			this._postInit();
+		},
 
+		_preInit: function() {
+			var def = $[ this.namespace ][ this.widgetName ].getDefaults();
+			this.options = jQuery.extend( true, {}, def, this.options );
+		},
+
+		_init: function() {
 			if( !this.options.displayedMonth ) {
 				this.options.displayedMonth = new Date( this.options.currentDate );
 			}
@@ -307,6 +316,9 @@
 			this._bindEvents();
 		},
 
+		_postInit: function() {
+		},
+
 		_getView: function() {
 			return View;
 		},
@@ -585,11 +597,18 @@
 
 	$.widget('lj.inlineCalendar', Calendar );
 
-	$.lj.inlineCalendar.setDefaults = function ( opts ) {
-		if( opts ) {
-			jQuery.extend( defaultOptions, opts );
+	jQuery.extend( $.lj.inlineCalendar, {
+
+		getDefaults: function() {
+			return defaultOptions;
+		},
+
+		setDefaults: function ( opts ) {
+			if( opts ) {
+				jQuery.extend( defaultOptions, opts );
+			}
 		}
-	};
+	} );
 
 } ( jQuery, window ) );
 

Tags: can3p, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments