Tinymce not working in angularjs mdDialog

人走茶凉 提交于 2019-12-22 09:14:17

问题


I'm trying to use TinyMCE editor in angularjs mdDialog.
Worling Plukr: http://embed.plnkr.co/s3NsemdcDAtG7AoQRvLh/


Plunkr with issues: http://embed.plnkr.co/fL8kGLl3b4TNdxW1AtKG/

All features are working normally instead of drop down: http://prntscr.com/fop9u0
It works fine if I increase the top position of drop down around 100px. http://prntscr.com/fope8o
I noticed that this problem appearing due to page scroll..

Can someone help me out to get these drop downs in right position.


回答1:


There is a top position calculation issue, It can be fixed adding below code in app.js file in `

$scope.addMoreInfoFunction = function(event) {
        setTimeout(function() {
            $('.mce-btn').on('click', function() {
                var bodyTop = $('body').offset().top;
                if (bodyTop < 0) {
                    setTimeout(function() {
                        var top = parseInt($('#mceu_50').css('top'));
                        var newTop = top / 2 - bodyTop - 30;
                        $('#mceu_50').css('top', newTop);
                        console.log(newTop);
                    }, 300);
                }
            });
        }, 300);
        $mdDialog.show({
            controller: ['$scope', '$mdDialog', DialogAddMoreInfoController],
            templateUrl: 'addMoreInfo.tmpl.html',
            parent: angular.element(document.body),
            targetEvent: event,
            clickOutsideToClose: true
        });
        };
        });

`

Calculation can be corrected, let know if it helps




回答2:


A CSS conflict possible a forced margin on all divs. So this is more of a integration issue than a tinymce bug. We have a few reset rules to remove the common conflicts.

   <style>
   .mce-tooltip
  {
    position: fixed !important;
  }
  .mce-panel.mce-floatpanel.mce-menu 
  {
    position: fixed !important;
  }
    </style>

Its not working perfectly. But it might help you to do something.



来源:https://stackoverflow.com/questions/44779101/tinymce-not-working-in-angularjs-mddialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!