Jump to content

Держите редактор открытым в темах

Featured Replies

1 час назад, avangcom сказал:

Привет
Как держать открытым редактор в теме???
Не нужно нажимать, чтобы открыть редактор и открыть следующим образом

013.thumb.jpg.c954dc85c0ed4a9decc0c1f38505a89b.jpg

открыть его при загрузке темы методами ips jquery

var editor = ips.ui.editor.getObj( $('[data-ipsEditor]') );
editor.unminimize();

 

4 minutes ago, avangcom said:

newload  

Hey

I set custom.css but didn't work

Yeah..

I also thought it would be it would be on custom.css 

 

Maybe putting that code inside on <script> tag on custom.css?
 

       

 

Not sure why didn't appear...

Like this: <script> var editor = ips . uh _ editor . getObj ( $ ( '[data-ipsEditor]' )  );
 editor . unminimize (); </script>

on custom.css

 

1 hour ago, avangcom said:

Hey dude!
Please be patient. Sometimes you have to wait for an answer because it's not the forum of 24/7 online support. Here is the open community for users that can help you when they will have free time. Without any regulations about responding time. 

avangcom это js код, можно вставить например в head или перед /body или в шаблон IncludeJS в самый конец

<script type="text/javascript">
;( function($, _, undefined){
"use strict";
	$(document).ready(function(){
		var editor = ips.ui.editor.getObj( $('[data-ipsEditor]') );
		editor.unminimize();
	});
}(jQuery, _));
</script>

 

8 часов назад, ZIKURIK сказал:

это js код, можно вставить например в head или перед /body или в шаблон IncludeJS в самый конец

в глобал не работает. кэш очищал

avangcom 

4 часа назад, SlawkA сказал:

в глобал не работает. кэш очищал

видимо редактор или функция получения объекта не успевает инициализироваться до выполнения нашей функции, можно просто отлавливать ошибку в setInterval

<script type="text/javascript">
;( function($, _, undefined){
"use strict";
  $(document).ready(function(){
    var editor = $('[data-role="replyArea"]').find('[data-ipsEditor]');
    if ( editor.length ) {
      var objInterval = setInterval( function () {
        try {
          ips.ui.editor.getObj( editor ).unminimize();
          clearInterval( objInterval );
        } catch (err) { }
      }, 400);
    }
  });
}(jQuery, _));
</script>

 

  • Author
3 hours ago, ZIKURIK said:

avangcom 

видимо редактор или функция получения объекта не успевает инициализироваться до выполнения нашей функции, можно просто отлавливать ошибку в setInterval

<script type="text/javascript">
;( function($, _, undefined){
"use strict";
  $(document).ready(function(){
    var editor = $('[data-role="replyArea"]').find('[data-ipsEditor]');
    if ( editor.length ) {
      var objInterval = setInterval( function () {
        try {
          ips.ui.editor.getObj( editor ).unminimize();
          clearInterval( objInterval );
        } catch (err) { }
      }, 400);
    }
  });
}(jQuery, _));
</script>

 

Я заметил, что Google Translator плохо переводит
Протестировать новый код???

  • 5 месяцев спустя...
  • 2 years later...
  • Author
On 4/7/2022 at 6:04 PM, Exception said:

@avangcom  

ظاهراً ویرایشگر یا تابع دریافت شی زمان لازم برای مقداردهی اولیه را قبل از اجرای تابع ما ندارد، شما به سادگی می توانید خطا را در setInterval دریافت کنید.

<script type="text/javascript">
;( function($, _, undefined){
"use strict";
  $(document).ready(function(){
    var editor = $('[data-role="replyArea"]').find('[data-ipsEditor]');
    if ( editor.length ) {
      var objInterval = setInterval( function () {
        try {
          ips.ui.editor.getObj( editor ).unminimize();
          clearInterval( objInterval );
        } catch (err) { }
      }, 400);
    }
  });
}(jQuery, _));
</script>

 

@Exception

hello

I tested this code on the version 5 template and put the code in the Java section, but it didn't work

You have to make a change in the code

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.