Skip to content

Commit

Permalink
Tab linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Powers committed Jul 4, 2013
1 parent 37f7bba commit 5daf453
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editor/editor.account.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function pagelines_welcome(){
<p>
Welcome to PageLines DMS, the world's first comprehensive drag and drop design management system.<br/>
You've made it this far, now let's take a minute to show you around. <br/>
<a href="#" class="dms-tab-link btn btn-success btn-mini"><i class="icon-user"></i> Add Account Info</a>
<a href="#" class="dms-tab-link btn btn-success btn-mini" data-tab-link="account" data-stab-link="account"><i class="icon-user"></i> Add Account Info</a>

</p>
<p>
Expand Down
49 changes: 47 additions & 2 deletions editor/js/pl.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
this.bindUIActions()

that.toggleGrid( true )




}
Expand Down Expand Up @@ -110,11 +112,54 @@

})



$("[data-tab-link]").on("click.tabLink", function(e) {

e.preventDefault()

var that = this
, tabLink = $(this).data('tab-link') || ''
, tabSubLink = $(this).data('stab-link')|| ''

that.tabLink( tabLink, tabSubLink)


})

if(getURLParameter('tablink')){
var tabLink = getURLParameter('tablink')
, tabSubLink = getURLParameter('tabsublink')|| ''

that.tabLink(tabLink, tabSubLink)
}
}

, tabLink: function(tabLink, tabSubLink){

var tabLink = tabLink || ''
, tabSubLink = tabSubLink || ''

tabSubLink = ( tabSubLink != '') ? tabSubLink : '0'

if( tabLink != '' ){

var tabLoad = (tabSubLink != '') ? tabSubLink : '0'

$('.panel-'+tabLink)
.attr('data-tab-load', tabSubLink)
.data('tab-load', tabSubLink)

$( '[data-action="'+tabLink+'"]' )
.trigger('click')

$('[data-tab-action="account"] a')
.trigger('click')

return
}


}

, toggleGrid: function( load, action){

var load = load || false
Expand Down
6 changes: 6 additions & 0 deletions editor/js/pl.library.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ function pl_html_input( text ) {
return jQuery.trim( pl_htmlEntities( pl_stripSlashes( text ) ) )
}

function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}

function pl_stripSlashes (str) {

return (str + '').replace(/\\(.?)/g, function (s, n1) {
Expand Down
2 changes: 1 addition & 1 deletion editor/panel.extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function toolbar( $toolbar ){
'filter'=> '*',
'type' => 'call',
'call' => array(&$this, 'the_store_callback'),
'icon' => 'icon-briefcase'
'icon' => 'icon-gears'
),
'heading2' => "<i class='icon-filter'></i> Filters",
'plus' => array(
Expand Down

0 comments on commit 5daf453

Please sign in to comment.