Skip to content

Commit

Permalink
[cs] Improved condition by optimizing code - set useCookie as default
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunjan Patel committed Sep 4, 2015
1 parent e8cccbc commit 17541d4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions libraries/cms/html/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,8 @@ protected static function loadBehavior($group, $params = array())
$opt['titleSelector'] = "dt.tabs";
$opt['descriptionSelector'] = "dd.tabs";

// Initialize value
$opt['useStorage'] = false;

// By default useCookie(this.options.display) is true
if (!isset($params['useCookie'])
|| (isset($params['useCookie']) && $params['useCookie']))
{
$opt['useStorage'] = true;
}
// When use storage is set and value is false - By default we allow to use storage
$opt['useStorage'] = (isset($params['useCookie']) && !$params['useCookie']) ? false : true;

$options = JHtml::getJSObject($opt);

Expand Down

0 comments on commit 17541d4

Please sign in to comment.