src/trumbowyg.js
function () {
            var t = this,
                fixedFullWidth = t.o.fixedFullWidth,
                $box = t.$box;

            if (!t.o.fixedBtnPane) {
                return;
            }

            t.isFixed = false;

            $(window)
                .on('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace, function () {
                    if (!$box) {
                        return;
                    }

                    t.syncCode();

                    var scrollTop = $(window).scrollTop(),
                        offset = $box.offset().top + 1,
                        bp = t.$btnPane,
                        oh = bp.outerHeight() - 2;

                    if ((scrollTop - offset > 0) && ((scrollTop - offset - t.height) < 0)) {
                        if (!t.isFixed) {
                            t.isFixed = true;
                            bp.css({
                                position: 'fixed',
                                top: 0,
                                left: fixedFullWidth ? '0' : 'auto',
                                zIndex: 7
                            });
                            $([t.$ta, t.$ed]).css({marginTop: bp.height()});
                        }
                        bp.css({
                            width: fixedFullWidth ? '100%' : (($box.width() - 1) + 'px')
                        });

                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: fixedFullWidth ? 'fixed' : 'absolute',
                            top: fixedFullWidth ? oh : oh + (scrollTop - offset) + 'px',
                            zIndex: 15
                        });
                    } else if (t.isFixed) {
                        t.isFixed = false;
                        bp.removeAttr('style');
                        $([t.$ta, t.$ed]).css({marginTop: 0});
                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: 'absolute',
                            top: oh
                        });
                    }
                });
        }
function () {
            var t = this,
                fixedFullWidth = t.o.fixedFullWidth,
                $box = t.$box;

            if (!t.o.fixedBtnPane) {
                return;
            }

            t.isFixed = false;

            $(window)
                .on('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace, function () {
                    if (!$box) {
                        return;
                    }

                    t.syncCode();

                    var scrollTop = $(window).scrollTop(),
                        offset = $box.offset().top + 1,
                        bp = t.$btnPane,
                        oh = bp.outerHeight() - 2;

                    if ((scrollTop - offset > 0) && ((scrollTop - offset - t.height) < 0)) {
                        if (!t.isFixed) {
                            t.isFixed = true;
                            bp.css({
                                position: 'fixed',
                                top: 0,
                                left: fixedFullWidth ? '0' : 'auto',
                                zIndex: 7
                            });
                            $([t.$ta, t.$ed]).css({marginTop: bp.height()});
                        }
                        bp.css({
                            width: fixedFullWidth ? '100%' : (($box.width() - 1) + 'px')
                        });

                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: fixedFullWidth ? 'fixed' : 'absolute',
                            top: fixedFullWidth ? oh : oh + (scrollTop - offset) + 'px',
                            zIndex: 15
                        });
                    } else if (t.isFixed) {
                        t.isFixed = false;
                        bp.removeAttr('style');
                        $([t.$ta, t.$ed]).css({marginTop: 0});
                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: 'absolute',
                            top: oh
                        });
                    }
                });
        }
function ( ) { var t = this , fixedFullWidth = t . o . fixedFullWidth , $box = t . $box ; if ( ! t . o . fixedBtnPane ) { return ; } t . isFixed = false ; $ ( window ) . on ( 'scroll.' + t . eventNamespace + ' resize.' + t . eventNamespace , function ( ) { if ( ! $box ) { return ; } t . syncCode ( ) ; var scrollTop = $ ( window ) . scrollTop ( ) , offset = $box . offset ( ) . top + 1 , bp = t . $btnPane , oh = bp . outerHeight ( ) - 2 ; if ( ( scrollTop - offset > 0 ) && ( ( scrollTop - offset - t . height ) < 0 ) ) { if ( ! t . isFixed ) { t . isFixed = true ; bp . css ( { position : 'fixed' , top : 0 , left : fixedFullWidth ? '0' : 'auto' , zIndex : 7 } ) ; $ ( [ t . $ta , t . $ed ] ) . css ( { marginTop : bp . height ( ) } ) ; } bp . css ( { width : fixedFullWidth ? '100%' : ( ( $box . width ( ) - 1 ) + 'px' ) } ) ; $ ( '.' + t . o . prefix + 'fixed-top' , $box ) . css ( { position : fixedFullWidth ? 'fixed' : 'absolute' , top : fixedFullWidth ? oh : oh + ( scrollTop - offset ) + 'px' , zIndex : 15 } ) ; } else if ( t . isFixed ) { t . isFixed = false ; bp . removeAttr ( 'style' ) ; $ ( [ t . $ta , t . $ed ] ) . css ( { marginTop : 0 } ) ; $ ( '.' + t . o . prefix + 'fixed-top' , $box ) . css ( { position : 'absolute' , top : oh } ) ; } } ) ; }
Management of fixed button pane
Management of fixed button pane