bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Tooltip and popover does not work on ie8

Open scesbron opened this issue 13 years ago • 3 comments

ie8 throw an exception

Error: Unknown execution error : {"number":-2146827688,"description":"Unknown execution error","message":"Unknown execution error"}

scesbron avatar Apr 26 '13 14:04 scesbron

At least Datepicker and Typeahead use custom tag directives which don't work with old IEs.

"IE has issues with element tag names which are not standard HTML tag names" -http://docs.angularjs.org/guide/ie

Workaround for UI-dev side is.

"The good news is that these restrictions only apply to element tag names, and not to element attribute names. So this requires no special handling in IE: <div my-tag your:tag> </div>."

IMHO to be on a safe side of things in any occasion all custom tags should be written as <div my-tag your:tag> </div>. Since programmers don't necessarily know what custom tags exist in templates.

Workaround for programmer side is to create all custom tags in HTML head.

<!--[if lte IE 8]>
      <script type="text/javascript">
        document.createElement('ng-include');
        document.createElement('ng-pluralize');
        document.createElement('ng-view');

        // Optionally these for CSS
        document.createElement('ng:include');
        document.createElement('ng:pluralize');
        document.createElement('ng:view');
      </script>
<![endif]-->

MattiJarvinen-BA avatar Aug 07 '13 09:08 MattiJarvinen-BA

We are not officially supporting IE8. See https://github.com/angular-ui/bootstrap#supported-browsers for more info.

The only way for IE8 support to happen is that someone will step in and invest into it, either time as a commiter or money by sponsoring this project.

pkozlowski-opensource avatar Aug 24 '13 16:08 pkozlowski-opensource

A solution would be modifing the template to:

      var template = 
        '<div '+ directiveName +'-popup '+
          'title="'+startSym+'tt_title'+endSym+'" '+
          'content="'+startSym+'tt_content'+endSym+'" '+
          'placement="'+startSym+'tt_placement'+endSym+'" '+
          'animation="tt_animation()" '+
          'is-open="tt_isOpen"'+
          '>'+
        '</div>';

and the tooltipPopup and tooltipHtmlUnsafePopup to accept atribute activation by setting:

.directive( 'tooltipPopup', function () {
  return {
    restrict: 'EA',
    replace: true,
    scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
    templateUrl: 'template/tooltip/tooltip-popup.html'
  };
})

.directive( 'tooltipHtmlUnsafePopup', function () {
  return {
    restrict: 'EA',
    replace: true,
    scope: { content: '@', placement: '@', animation: '&', isOpen: '&' },
    templateUrl: 'template/tooltip/tooltip-html-unsafe-popup.html'
  };
})

I tested the solution and it works on IE7+ (grunt build completed successfully with all tests and it renders in browser). If the bootstrap-ui team is interested in this fix for IE7+ I can create a pull request..

You can view an example here http://plnkr.co/edit/fQk1CjeVdnUckVvKmGKW?p=preview. You will need to open the plunker site in another browser and the click "launch the preview in another window", then you have a run.plnkr link to use in IE7. All this fuss because plnkr doesn't load in IE<10..

ntrp avatar Nov 08 '13 12:11 ntrp