Back to PhocacartRenderMedia class

Method loadTouchSpin

public
loadTouchSpin
(mixed $name, mixed $icons, mixed $load = true)

Method loadTouchSpin - Source code

public function loadTouchSpin($name, $icons, $load = true)
{
    $jsS = "\n" . 'jQuery(document).ready(function(){' . "\n";
    $js = '   jQuery("input[name=\'' . $name . '\']:visible").TouchSpin({';
    $js .= '   verticalbuttons: true,';
    if ($this->p['quantity_input_spinner'] == 2) {
        $js .= '   verticalup: \'<span class="' . $icons['chevron-up'] . '"></span>\',';
        $js .= '   verticaldown: \'<span class="' . $icons['chevron-down'] . '"></span>\',';
    } else {
        $js .= '   verticalup: \'<span class="' . $icons['plus'] . '"></span>\',';
        $js .= '   verticaldown: \'<span class="' . $icons['minus'] . '"></span>\',';
    }
    //$js .= '   verticalupclass: "'.PhocacartRenderIcon::getClass('chevron-up').'",';
    //$js .= '   verticaldownclass: "'.PhocacartRenderIcon::getClass('chevron-down').'"';
    $js .= ' })';
    $jsE = '});' . "\n";
    if ($this->p['quantity_input_spinner'] > 0 && $load && $this->load) {
        //$this->document->addScript(JUri::root(true).'/media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin'.$this->t['min'].'.js');
        //JHtml::stylesheet( 'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.css' );
        //HTMLHelper::_('stylesheet', 'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.css', array('version' => 'auto'));
        // HTMLHelper::_('script', 'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin' . $this->t['min'] . '.js', array('version' => 'auto'), $this->scriptAtributeInline);
        $this->wa->registerAndUseStyle('com_phocacart.jquery.bootstrap-touchspin', 'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.css', array('version' => 'auto'));
        $this->wa->registerAndUseScript('com_phocacart.jquery.bootstrap-touchspin', 'media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin' . $this->t['min'] . '.js', array('version' => 'auto'), $this->scriptAtributeInline);
        $this->wa->addInlineScript($jsS . $js . $jsE);
        // $this->document->addScriptDeclaration($jsS . $js . $jsE);
    }
    //return $js;
}