src/sap.ui.demokit/src/sap/ui/demokit/explored/view/base.controller.js
function () {

			var sJson = this._oStorage.get(this._sStorageKey);
			if (!sJson) {

				// local storage is empty, apply defaults
				this._oViewSettings = this._oDefaultSettings;

			} else {
				// parse
				this._oViewSettings = JSON.parse(sJson);

				// clean filter and remove values that do not exist any longer in the data model
				// (the cleaned filter are not written back to local storage, this only happens on changing the view settings)
				//var oFilterData = this.getView().getModel("filter").getData();
				var oFilterData = this.getOwnerComponent().getModel("filter").getData();
				var oCleanFilter = {};
				jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) {
					var aNewValues = [];
					jQuery.each(aValues, function (i, aValue) {
						var bValueIsClean = false;
						jQuery.each(oFilterData[sProperty], function (i, oValue) {
							if (oValue.id === aValue) {
								bValueIsClean = true;
								return false;
							}
						});
						if (bValueIsClean) {
							aNewValues.push(aValue);
						}
					});
					if (aNewValues.length > 0) {
						oCleanFilter[sProperty] = aNewValues;
					}
				});
				this._oViewSettings.filter = oCleanFilter;

				// handling data stored with an older explored versions
				if (!this._oViewSettings.hasOwnProperty("compactOn")) { // compactOn was introduced later
					this._oViewSettings.compactOn = false;
				}

				if (!this._oViewSettings.hasOwnProperty("themeActive")) { // themeActive was introduced later
					this._oViewSettings.themeActive = "sap_bluecrystal";
				} else if (this._oViewSettings.version !== this._oDefaultSettings.version) {
					var oVersion = jQuery.sap.Version(sap.ui.version);
					if (oVersion.compareTo("1.40.0") >= 0) { 	// Belize theme is available since 1.40
						this._oViewSettings.themeActive = "sap_belize";
					} else { // Fallback to BlueCrystal for older versions
						this._oViewSettings.themeActive = "sap_bluecrystal";
					}
				}

				if (!this._oViewSettings.hasOwnProperty("rtl")) { // rtl was introduced later
					this._oViewSettings.rtl = false;
				}

				// handle RTL-on in settings as this need a reload
				if (this._oViewSettings.rtl && !jQuery.sap.getUriParameters().get('sap-ui-rtl')) {
					this._handleRTL(true);
				}
			}
		}
function () {

			var sJson = this._oStorage.get(this._sStorageKey);
			if (!sJson) {

				// local storage is empty, apply defaults
				this._oViewSettings = this._oDefaultSettings;

			} else {
				// parse
				this._oViewSettings = JSON.parse(sJson);

				// clean filter and remove values that do not exist any longer in the data model
				// (the cleaned filter are not written back to local storage, this only happens on changing the view settings)
				//var oFilterData = this.getView().getModel("filter").getData();
				var oFilterData = this.getOwnerComponent().getModel("filter").getData();
				var oCleanFilter = {};
				jQuery.each(this._oViewSettings.filter, function (sProperty, aValues) {
					var aNewValues = [];
					jQuery.each(aValues, function (i, aValue) {
						var bValueIsClean = false;
						jQuery.each(oFilterData[sProperty], function (i, oValue) {
							if (oValue.id === aValue) {
								bValueIsClean = true;
								return false;
							}
						});
						if (bValueIsClean) {
							aNewValues.push(aValue);
						}
					});
					if (aNewValues.length > 0) {
						oCleanFilter[sProperty] = aNewValues;
					}
				});
				this._oViewSettings.filter = oCleanFilter;

				// handling data stored with an older explored versions
				if (!this._oViewSettings.hasOwnProperty("compactOn")) { // compactOn was introduced later
					this._oViewSettings.compactOn = false;
				}

				if (!this._oViewSettings.hasOwnProperty("themeActive")) { // themeActive was introduced later
					this._oViewSettings.themeActive = "sap_bluecrystal";
				} else if (this._oViewSettings.version !== this._oDefaultSettings.version) {
					var oVersion = jQuery.sap.Version(sap.ui.version);
					if (oVersion.compareTo("1.40.0") >= 0) { 	// Belize theme is available since 1.40
						this._oViewSettings.themeActive = "sap_belize";
					} else { // Fallback to BlueCrystal for older versions
						this._oViewSettings.themeActive = "sap_bluecrystal";
					}
				}

				if (!this._oViewSettings.hasOwnProperty("rtl")) { // rtl was introduced later
					this._oViewSettings.rtl = false;
				}

				// handle RTL-on in settings as this need a reload
				if (this._oViewSettings.rtl && !jQuery.sap.getUriParameters().get('sap-ui-rtl')) {
					this._handleRTL(true);
				}
			}
		}
function ( ) { var sJson = this . _oStorage . get ( this . _sStorageKey ) ; if ( ! sJson ) { // local storage is empty, apply defaults this . _oViewSettings = this . _oDefaultSettings ; } else { // parse this . _oViewSettings = JSON . parse ( sJson ) ; // clean filter and remove values that do not exist any longer in the data model // (the cleaned filter are not written back to local storage, this only happens on changing the view settings) //var oFilterData = this.getView().getModel("filter").getData(); var oFilterData = this . getOwnerComponent ( ) . getModel ( "filter" ) . getData ( ) ; var oCleanFilter = { } ; jQuery . each ( this . _oViewSettings . filter , function ( sProperty , aValues ) { var aNewValues = [ ] ; jQuery . each ( aValues , function ( i , aValue ) { var bValueIsClean = false ; jQuery . each ( oFilterData [ sProperty ] , function ( i , oValue ) { if ( oValue . id === aValue ) { bValueIsClean = true ; return false ; } } ) ; if ( bValueIsClean ) { aNewValues . push ( aValue ) ; } } ) ; if ( aNewValues . length > 0 ) { oCleanFilter [ sProperty ] = aNewValues ; } } ) ; this . _oViewSettings . filter = oCleanFilter ; // handling data stored with an older explored versions if ( ! this . _oViewSettings . hasOwnProperty ( "compactOn" ) ) { // compactOn was introduced later this . _oViewSettings . compactOn = false ; } if ( ! this . _oViewSettings . hasOwnProperty ( "themeActive" ) ) { // themeActive was introduced later this . _oViewSettings . themeActive = "sap_bluecrystal" ; } else if ( this . _oViewSettings . version !== this . _oDefaultSettings . version ) { var oVersion = jQuery . sap . Version ( sap . ui . version ) ; if ( oVersion . compareTo ( "1.40.0" ) >= 0 ) { // Belize theme is available since 1.40 this . _oViewSettings . themeActive = "sap_belize" ; } else { // Fallback to BlueCrystal for older versions this . _oViewSettings . themeActive = "sap_bluecrystal" ; } } if ( ! this . _oViewSettings . hasOwnProperty ( "rtl" ) ) { // rtl was introduced later this . _oViewSettings . rtl = false ; } // handle RTL-on in settings as this need a reload if ( this . _oViewSettings . rtl && ! jQuery . sap . getUriParameters ( ) . get ( 'sap-ui-rtl' ) ) { this . _handleRTL ( true ) ; } } }
Inits the view settings. At first local storage is checked. If this is empty defaults are applied.
Inits the view settings . At first local storage is checked . If this is empty defaults are applied .