Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/css/rangeslider.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
display: flex;
x-justify-content: space-around;
x-align-items: stretch;
padding: .45em;
border: 2px solid #ddd;
background: #fff;
}

.rangeslider-slider-wrapper {
Expand Down
26 changes: 13 additions & 13 deletions rangeslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class RangeSliderField extends InputField
*
* @var array
*/
public static $assets = array(
'css' => array(
public static $assets = [
'css' => [
'nouislider-8.1.0.min.css',
'rangeslider.css',
),
'js' => array(
],
'js' => [
'nouislider-8.1.0.min.js',
'wnumb-1.0.2.min.js',
'rangeslider.js',
),
);
],
];

/**
* Minimum value.
Expand Down Expand Up @@ -184,7 +184,7 @@ public function input()
$input = new Brick('input');

/* Set general attributes */
$input->attr(array(
$input->attr([
'type' => 'text',
'name' => $this->name(),
'id' => $this->id(),
Expand All @@ -194,19 +194,19 @@ public function input()
'tabindex' => '-1',
'disabled' => $this->option('disabled'),
'readonly' => $this->option('readonly'),
));
]);

$input->addClass('input-is-readonly');

/* Set data attributes */
$input->data(array(
$input->data([
'field' => 'rangesliderfield',
'min' => $this->option('min'),
'max' => $this->option('max'),
'min' => $this->option('min') == 0 || $this->option('min') == false ? 0 : $this->option('min'),
'max' => $this->option('max') == 0 || $this->option('max') == false ? 0 : $this->option('max'),
'step' => $this->option('step'),
'prefix' => $this->option('prefix'),
'postfix' => $this->option('postfix'),
));
]);

return $input;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ public function element()
*/
public function content()
{
$content = Tpl::load(__DIR__ . DS . 'partials' . DS . 'content.php', array('field' => $this));
$content = Tpl::load(__DIR__.DS.'partials'.DS.'content.php', ['field' => $this]);

return $content;
}
Expand Down