Sha256: 9ce45c8d748eb170d4915e228fb8e65fc604b8e0795a3cc3916d8b57791c62c1

Contents?: true

Size: 830 Bytes

Versions: 2

Compression:

Stored size: 830 Bytes

Contents

"use strict";

var ItemOptions = function (wrapper){

    var _$wrapper;
    var _cur_val = {

    };

    var _get_cur_val = function() {
        return _cur_val;
    };

    var _fCollectOptions = function() {
        _$wrapper.find('div.checkbox').each(function() {
            var $t = $(this);
            var tag = $t.data('tag');
            var $inp = $t.find('input');
            var val = $inp[0].checked;
            _cur_val[tag] = val;
            console.log('<_fCollectOptions> val = ' + val + ": " + tag);
        });
        console.log(_cur_val);
    }

    var _fInitBehaviour = function (){
        _fCollectOptions();
    };

    var _fInit = function (wrapper){
        _$wrapper = $(wrapper);
        _fInitBehaviour();
    };

    _fInit(wrapper);

    return {
        get_cur_val: _get_cur_val
    }

};

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
c80_yax-0.1.0.20 app/assets/javascripts/c80_yax/frontend/item_options/item_options.js
c80_yax-0.1.0.18 app/assets/javascripts/c80_yax/frontend/item_options/item_options.js