Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $_widgetName = 'tab_panel';
- widgetControls[ $_widgetName ] =
- {
- tab_panel :
- {
- actions :
- {
- init : function( )
- {
- var self = this,
- __obj = self.param;
- var getParam = function ( __obj ) {
- var _param = {};
- $( __obj ).find( 'span._param' ).each(
- function() {
- var val = $( this ).html();
- with(this) {
- _param = eval( '_param = ' + val );
- }
- }
- )
- return _param;
- }
- var param = getParam( __obj );
- with ( param ) {
- var key;
- for( key in buttons ) {
- var title = key
- ,source = buttons[ key ]
- var widget = self.wc.buildWidget( 'button', {id:title} );
- $(self.get( 'pager:editor_pager/pager__bar' )).append(widget)
- //self.get( 'pager:editor_pager' ).create_shortcut( title, source, source);
- }
- for( key in system ) {
- switch ( key ) {
- case 'source':
- var val = system[ key ];
- $.getJSON(
- '/get-all/' + val
- ,''
- ,function ( data ){
- alert(val)
- cache[ '/get-html/' + val ] = data.html_code;
- cache[ '/get-css/' + val ] = data.css_code;
- cache[ '/get-js/' + val ] = data.js_code;
- $('.widget_name').val( data.name )
- }
- ) // get JSON data
- break; // source
- case 'active':
- self.widget_data.active_item = $('');
- break; // active
- default:
- break; // default
- } // switch
- }
- }
- }
- ,after : function( )
- {
- this.widget_data.active_item.doActive();
- }
- }
- }
- ,tab_panel__content :
- {
- events :
- {
- click : function() {
- }
- }
- }
- ,tab_panel__content_container :
- {
- subs :
- {
- 'tab_panel/pager:editor_pager/pager_bar/button' :
- {
- tab_selected: function ( param )
- {
- //$( this.get('tab_panel__content_container') ).val( cache[ param ] );
- alert(4)
- }
- }
- }
- ,events :
- {
- click : function() {
- },
- keyup : function() {
- this.get('list_selector:bricks_listing')
- .pub(
- 'createListing',
- getMe(getClasses())
- );
- // console.log( $(this) )
- // var source = this.get('pager:editor_pager').widget_data.active_source;
- // cache[ source ] = $( this ).val();
- // if ( $( '.start_on_button' ).prop( 'checked' ) ) {
- // doIt2();
- // }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement