MCPcopy
hub / github.com/ollm/OpenComic / addComicButtons

Function addComicButtons

scripts/dom.js:1895–1957  ·  view source on GitHub ↗
(show = true, first = true)

Source from the content-addressed store, hash-verified

1893var addComicButtonsST = false, addComicButtonsActive = false;
1894
1895function addComicButtons(show = true, first = true)
1896{
1897 clearTimeout(addComicButtonsST);
1898
1899 if(show)
1900 {
1901 var more = false, have = false;
1902
1903 $($('.floating-action-button-min').get().reverse()).each(function(){
1904
1905 if(!$(this).hasClass('s'))
1906 {
1907 if(!have)
1908 $(this).removeClass('h').addClass('s');
1909 else
1910 more = true;
1911
1912 have = true;
1913 }
1914
1915 });
1916
1917 if(more)
1918 addComicButtonsST = setTimeout(function(){addComicButtons(true, false)}, 50);
1919
1920 if(first)
1921 {
1922 floatingActionButton(true, 'dom.addComicButtons(false);');
1923 $('.floating-action-button-add > div').css('transform', 'rotate(135deg)');
1924 }
1925
1926 addComicButtonsActive = true;
1927 }
1928 else
1929 {
1930 var more = false, have = false;
1931
1932 $('.floating-action-button-min').each(function(){
1933
1934 if(!$(this).hasClass('h'))
1935 {
1936 if(!have)
1937 $(this).removeClass('s').addClass('h');
1938 else
1939 more = true;
1940
1941 have = true;
1942 }
1943
1944 });
1945
1946 if(more)
1947 addComicButtonsST = setTimeout(function(){addComicButtons(false, false)}, 50);
1948
1949 if(first)
1950 {
1951 floatingActionButton(true, 'dom.addComicButtons();');
1952 $('.floating-action-button-add > div').css('transform', '');

Callers 1

floatingActionButtonFunction · 0.85

Calls 1

floatingActionButtonFunction · 0.85

Tested by

no test coverage detected