Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive CSS - TbButtonColumn.php Icons #557

Closed
pawl opened this issue Jun 15, 2013 · 4 comments
Closed

Responsive CSS - TbButtonColumn.php Icons #557

pawl opened this issue Jun 15, 2013 · 4 comments
Milestone

Comments

@pawl
Copy link

pawl commented Jun 15, 2013

The icons in TbButtonColumn.php will not work if Responsive CSS is enabled. However, they will work if fontawesome CSS is turned on. Does font awesome need to be automatically enabled if responsive CSS is enabled?

@acuencadev
Copy link

I have the same issue. Do you fix it?

@pawl
Copy link
Author

pawl commented Jul 12, 2013

Nope, but I'm currently have the fontawesome CSS + responsive CSS turned on and icons will show. You need to enable that in the php configuration file in yiibooster.

@GerhardLiebenberg
Copy link

This might also be an issue:

If you want to display images for your buttons, then you have to set 'icon' => false,

But the 'else if' statement in TbButtonColumn.php (line 79) results in the $imageUrl code NOT being executed when 'icon' => false.

I have reported this issue, but in the meantime, I just changed the TbButtonColumn.php file from this:

    if (isset($button['icon'])) {
        if (strpos($button['icon'], 'icon') === false) {
            $button['icon'] = 'icon-' . implode(' icon-', explode(' ', $button['icon']));
        }

        echo CHtml::link('<i class="' . $button['icon'] . '"></i>', $url, $options);
    } else if (isset($button['imageUrl']) && is_string($button['imageUrl'])) {
        echo CHtml::link(CHtml::image($button['imageUrl'], $label), $url, $options);
    } else {
        echo CHtml::link($label, $url, $options);
    }

to this:

    if (isset($button['icon'])) {
        if (strpos($button['icon'], 'icon') === false) {
            $button['icon'] = 'icon-' . implode(' icon-', explode(' ', $button['icon']));

            if (isset($button['imageUrl']) && is_string($button['imageUrl'])) 
                echo CHtml::link(CHtml::image($button['imageUrl'], $label), $url, $options);
        }

        echo CHtml::link('<i class="' . $button['icon'] . '"></i>', $url, $options);
    } else if (isset($button['imageUrl']) && is_string($button['imageUrl'])) {
        echo CHtml::link(CHtml::image($button['imageUrl'], $label), $url, $options);
    } else {
        echo CHtml::link($label, $url, $options);
    }

@amrbedair
Copy link
Contributor

I think both of these are fixed in a recent commit ...
please re open the issue if you still facing any problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants