Skip to content

Commit

Permalink
Changes to the struts skin
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Adams committed Oct 20, 2011
1 parent 58a8f9c commit 6c2c44e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/struts/option.php
Expand Up @@ -133,7 +133,7 @@ public function to_html() {
$this->description_html();
$this->input_html();

if ( ! Struts::config( 'use_struts_skin' ) ) {
if ( Struts::config( 'use_struts_skin' ) ) {
echo "</div>";
}

Expand Down
2 changes: 1 addition & 1 deletion classes/struts/option/color.php
Expand Up @@ -25,7 +25,7 @@ protected function standard_validation( $value ) {
protected function label_html() {
if ( $this->label() ) {
echo "<label class='struts-label' for='{$this->html_id()}'>{$this->label()} ";
echo '<a href="#" class="color-chooser-toggle">' . __( 'hide color picker', 'TODO' ) . '</a>';
echo '<a href="#" class="struts-color-chooser-toggle">' . __( 'show color picker', 'TODO' ) . '</a>';
echo "</label>";
}
}
Expand Down
6 changes: 5 additions & 1 deletion classes/struts/section.php
Expand Up @@ -70,6 +70,7 @@ public function options( $options = NULL ) {
public function add_option( Struts_Option $option ) {
$this->_options[$option->name()] = $option;
}

public function to_html() {
echo "<div class='struts-section'>";
echo "<h3>{$this->title()} <a href='#'>" . __( 'Edit', 'TODO' ) . '</a></h3>';
Expand All @@ -78,7 +79,10 @@ public function to_html() {
$option->to_html();
}

echo "</div></div>";
echo '<div class="struts-save-button submit">';
echo '<input type="submit" class="button-primary struts-save-button" value="' . __( 'Save changes', 'TODO' ) . '" />';

echo "</div></div></div>";

}
}
4 changes: 3 additions & 1 deletion javascripts/struts.js
Expand Up @@ -31,7 +31,9 @@ jQuery(document).ready(function($) {
jQuery(this).next("div").slideToggle( 'fast' );
return false;
});
jQuery( '.color-chooser-toggle' ).click(function() {

jQuery('.struts-color-chooser').hide();
jQuery( '.struts-color-chooser-toggle' ).click(function() {
var colorchooser = jQuery(this).parent().next();

colorchooser.toggle();
Expand Down

0 comments on commit 6c2c44e

Please sign in to comment.